Perl: How to get awk output from variable -



Perl: How to get awk output from variable -

i getting syntax error awk.

value = a|b|c|d|e|f|g|h $record = `$value | awk -f "|" '{print $5}'`;

thanks,

if you're ever tempted phone call awk perl you're doing wrong. perl can pretty much awk can - , more efficiently , more portably.

my $value = 'a|b|c|d|e|f|g|h'; $record = (split /\|/, $value)[4]; # 4, not 5 perl arrays zero-indexed

perl

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -