Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: extracting data from string

by moritz (Cardinal)
on Jul 16, 2012 at 10:59 UTC ( #982006=note: print w/replies, xml ) Need Help??


in reply to extracting data from string

but a single statement has to do it

Why? You seem to optimize for a really silly thing. The code should be understandable and robust. See also: The path to mastery.

Anyway, you can do this:

for ("!defined(FLOAT_CODE)", "defined(FIXED_CODE)") { /^(!?)defined\((\w+)\)/ and print "$1$2\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982006]
help
Chatterbox?
[marioroy]: Also \"%S\\\n\" oh my, not fun.
[Discipulus]: good night folks
[marioroy]: I will make a mp3info script that takes the -p "%S\n" args and test qx. I'm on the road, so will come back.
[marioroy]: All because File::Find is not fun for LA.
[marioroy]: good night Discipulus.
[Discipulus]: perl dreams to you all
[marioroy]: LA my @music_times = qx(find \$HOME/Music/ Albums -type f -iname \'*.mp3\' -exec mp3info -p \"%S\\n\" {} \\;);

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-04-23 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.