Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Processing words in a file.

by kcott (Chancellor)
on Feb 12, 2013 at 07:24 UTC ( #1018311=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -Mstrict -Mwarnings -E '
    my $line = q{xxx yy yy:yy:yy xxx/xxxxx xxx xxxx xxx xxx};
    ...
    say $fields[2];
    '
    yy:yy:yy
    
  2. or download this
    $ perl -Mstrict -Mwarnings -E '
    use constant {
    ...
    say $fields[TIME];
    '
    yy:yy:yy
    
  3. or download this
    $ perl -Mstrict -Mwarnings -E '
    my $line = q{xxx yy yy:yy:yy xxx/xxxxx xxx xxxx xxx xxx};
    ...
    say $time;
    '
    yy:yy:yy
    
  4. or download this
    $ perl -Mstrict -Mwarnings -E '
    my $line = q{xxx 1 12:34:56 xxx/xxxxx xxx xxxx xxx xxx};
    ...
    say $hour;
    '
    12
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018311]
help
Chatterbox?
usemodperl enters an empty gate

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2018-06-23 18:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?