Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Simple awk question

by LanX (Sage)
on Jun 05, 2014 at 18:03 UTC ( #1088887=note: print w/replies, xml ) Need Help??


in reply to Re: Simple awk question
in thread Simple awk question

perl -e 'print (split /\s+/, "'$variable'")[0]'

nested quotes? :)

update

and the brackets belong to print , (...)[0] won't work.

Cheers Rolf

(addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1088887]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2022-05-18 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?