Search Results

Search found 10620 results on 425 pages for 'perl module'.

Page 27/425 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Perl - Compare two files and copy intire line to final.log

    - by user2977141
    I need perl script to compare line from file1 with file2 and copy to final file, something like this: File1.txt: ASPO01 ASPO02 ASPO03 File2.txt: ASPO01 2013-11-10 19hrs ASPO10 2013-11-09 24hrs ASPO02 2013-11-08 10hrs ASPO16 2013-11-05 9hrs ASPO17 2013-11-06 6hrs ASPO03 2013-11-07 15hrs ASPO18 2013-11-02 25hrs ... Search into File2 and copy to final file called final.log, like this: final.txt: ASPO01 2013-11-10 19hrs ASPO02 2013-11-08 10hrs ASPO03 2013-11-07 15hrs Thanks for all good friends can help me!!!

    Read the article

  • Perl Substitution

    - by Marlin
    hi, I have a variable which stores the path on Windows. I want to replace all the \ with / in the path. for eg. $path = C:\Users\scripts.ps1 Am new to Perl and tried something like $path = s/\//// But it didnt work. can you please help me out....

    Read the article

  • Perl ENV variable contains newline and tab

    - by Michael
    Say I have an environment variable myvar myvar=\tapple\n when the following command will print out this variable perl -e 'print "$ENV{myvar}"' I will literally have \tapple\n, however, I want those control chars to be evaluated and not escaped. How would I achieve it? In the real world $ENV residing in substitution, but I hope the answer will cover that.

    Read the article

  • Parsing command line options in Perl

    - by Jay Gridley
    Hi guys, I am parsing command line options in Perl using Getopt::Long. I am forced to use prefix - (one dash) for short commands (-s) and -- (double dash) for long commands (ex. --input=file), but problem is, that there is one special option (-r=) so it is long option for its requirement for argument, but it has to have one dash (-) prefix not double dash (--) like other long options. Is possible to setup Getopt::Long to accept these?

    Read the article

  • Perl, search array

    - by Mike
    What is the smartest way of searching through an array of strings for a matching string in Perl? One caveat, I would like the search to be case-insensitive so "aAa" would be in ("aaa","bbb")

    Read the article

  • Create comma seperated values in perl

    - by Mike
    Let's say I have a list of elements @list=(1,2,3); #desired output 1,2,3 And I want to print them as comma seperated values. And most importantly, I do not want the last element to have a comma after it. What is the cleanest way to do this in Perl?

    Read the article

  • comparing 2 arrays on perl

    - by qrbaQ
    could someone provide a good /nice solution in perl for comparing 2 arrays (a and b ) which check if every element on array a is founded on array b (and founded only once on array b) ?

    Read the article

  • perl + want to put uniq char as @ without backslash "\"

    - by yael
    I need to know if there is some way to replace any string as @ or * or ? or & without to put the "\" before it Example perl -pe 'next if /^#/; s/\@d\&/new_value/ if /param5/' test in this example need to replace the @d& with new_value but I need to put the "\" before @ or & can be other way without to put the "\" because I have random char that can be in the old value.

    Read the article

  • Perl, redirect stdout to file

    - by Mike
    I'm looking for an example of redirecting stdout to a file using Perl. I'm doing a fairly straightforward fork/exec tool, and I want to redirect the child's output to a file instead of the parents stdout. Is there an equivilant of dup2() I should use? I can't seem to find it

    Read the article

  • Perl Term::ReadKey don't wait for newline

    - by tim
    In a perl script, I'm trying to accept input without blocking and without echoing the characters entered (The script is producing output and I want to have 'hotkeys' to alter its behaviour). I got as far as using use Term::ReadKey; ReadMode( "cbreak", STDIN ); if($input = ReadKey($pause_time, STDIN)){ #process input } But once the user types anything then the script stops until a newline is entered. I'd like the input to be processed per-character, without waiting for a newline.

    Read the article

  • Perl like regex in Python

    - by anansi
    In Perl I would do something like this for taking different fields in a regexp, separating different fields by () and getting them using $ foreach $line (@lines) { $line =~ m/(.*?):([^-]*)-(.*)/; $field_1 = $1 $field_2 = $2 $field_3 = $3 } How could I do something like this in Python?

    Read the article

  • Why does my Perl CGI script raise an internal server error on Apache?

    - by itcplpl
    I've installed apache2 on Ubuntu 11.04, and localhost is working. I created a simple printenv.pl script and put it in the following directory $ mv printenv.pl /usr/lib/cgi-bin/ $ chmod +rx /usr/lib/cgi-bin/printenv.pl However when I go to http://127.0.0.1/cgi-bin/printenv.pl, I get a 500 Internal Server Error I checked the error log at /var/log/apache2, and this is what it says: [Mon Oct 24 11:04:25 2011] [error] (13)Permission denied: exec of '/usr/lib/cgi-bin/printenv.pl' failed [Mon Oct 24 11:04:25 2011] [error] [client 127.0.0.1] Premature end of script headers: printenv.pl Any suggestions on how I can fix this and run CGI scripts on my localhost?

    Read the article

  • What conventions or frameworks exist for MVVM in Perl?

    - by Will Sheppard
    We're using Catalyst to render lots of webforms in what will become a large application. I don't like the way all the form data is confusingly into a big hash in the Controller, before being passed to the template. It seems jumbled up and messy for the template. I'm sure there are real disadvantages that I haven't described properly... Are there? One solution is to just decide on a convention for the hash, e.g.: { defaults => { type => ['a', 'b', 'c'] }, input => { type => 'a' }, output => { message => "2 widgets found of type a", widgets => [ 'foo', 'bar' ] } } Another way is to store the page/form data as attributes in a class (a ViewModel?), and pass a whole object to the template, which it could use like this: <p class="message">[% model.message %]<p> [% FOREACH widget IN model.widgets %] Which way is more flexible for large applications? Are there any other solutions or existing Catalyst-compatible frameworks?

    Read the article

  • How to profile a Perl + FastCGi + StarRunner web program?

    - by Paul Tomblin
    I've written an extension to RequestTracker for a client, but he says the performance isn't good enough. I'd like to do some profiling, but I'm not sure how to connect up a profiler (say NYTProf, for example)? I tried what the man page says and put PerlModule Devel::NYTProf::Apache in my apache config, but all I get in the results are Apache2:XSLoader, Devel::NYTProf::Apache and ModPerl::Util modules in the results, and neither my own nor RT's modules.

    Read the article

  • Drupal: Exposing a module's data to Views2 using its API

    - by Sepehr Lajevardi
    I'm forking the filefield_stats module to provide it with the ability of exposing data into the Views module via the API. The filefield_stats module db table schema is as follow: <?php function filefield_stats_schema() { $schema['filefield_stats'] = array( 'fields' => array( 'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'Primary Key: the {files}.fid'), 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'Primary Key: the {node}.vid'), 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'The {users}.uid of the downloader'), 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'The timestamp of the download'), 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', 'description' => 'The hostname downloading the file (usually IP)'), 'referer' => array('type' => 'text', 'not null' => FALSE, 'description' => 'Referer for the download'), ), 'indexes' => array('fid_vid' => array('fid', 'vid')), ); return $schema; } ?> Well, so I implemented the hook_views_api() in filefield_stats.module & added a filefield_stats.views.inc file in the module's root directory, here it is: <?php // $Id$ /** * @file * Provide the ability of exposing data to Views2, for filefield_stats module. */ function filefield_stats_views_data() { $data = array(); $data['filefield_stats']['table']['group'] = t('FilefieldStats'); // Referencing the {node_revisions} table. $data['filefield_stats']['table']['join'] = array( 'node_revisions' => array( 'left_field' => 'vid', 'field' => 'vid', ), /*'files' => array( 'left_field' => 'fid', 'field' => 'fid', ), 'users' => array( 'left_field' => 'uid', 'field' => 'uid', ),*/ ); // Introducing filefield_stats table fields to Views2. // vid: The node's revision ID which wrapped the downloaded file $data['filefield_stats']['vid'] = array( 'title' => t('Node revision ID'), 'help' => t('The node\'s revision ID which wrapped the downloaded file'), 'relationship' => array( 'base' => 'node_revisions', 'field' => 'vid', 'handler' => 'views_handler_relationship', 'label' => t('Node Revision Reference.'), ), ); // uid: The ID of the user who downloaded the file. $data['filefield_stats']['uid'] = array( 'title' => t('User ID'), 'help' => t('The ID of the user who downloaded the file.'), 'relationship' => array( 'base' => 'users', 'field' => 'uid', 'handler' => 'views_handler_relationship', 'label' => t('User Reference.'), ), ); // fid: The ID of the downloaded file. $data['filefield_stats']['fid'] = array( 'title' => t('File ID'), 'help' => t('The ID of the downloaded file.'), 'relationship' => array( 'base' => 'files', 'field' => 'fid', 'handler' => 'views_handler_relationship', 'label' => t('File Reference.'), ), ); // hostname: The hostname which the file has been downloaded from. $data['filefield_stats']['hostname'] = array( 'title' => t('The Hostname'), 'help' => t('The hostname which the file has been downloaded from.'), 'field' => array( 'handler' => 'views_handler_field', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort', ), 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), ); // referer: The referer address which the file download link has been triggered from. $data['filefield_stats']['referer'] = array( 'title' => t('The Referer'), 'help' => t('The referer which the file download link has been triggered from.'), 'field' => array( 'handler' => 'views_handler_field', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort', ), 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), ); // timestamp: The time of the download. $data['filefield_stats']['timestamp'] = array( 'title' => t('Download Time'), 'help' => t('The time of the download.'), 'field' => array( 'handler' => 'views_handler_field_date', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_date', ), 'filter' => array( 'handler' => 'views_handler_filter_date', ), ); return $data; } // filefield_stats_views_data() ?> According to the Views2 documentations this should work as a minimum, I think. But it doesn't! Also there is no error of any kind, when I come through the views UI, there's nothing about filefield_stats data. Any idea?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >