I posted this on the news group comp.lang.perl yesterday and since I have
not received a response (and it does not look very active) I am cross
posting it here.

 

 

This works:

@p= split "\\.", @ARGV[0];

print "$p[0]\n"

 

I want to write it as a onliner. How so I do that? Here is my attempt:

 

print (@{split "\\.", @ARGV[0]})[0];

 

How do I index directly without explicitly creating a temporary variable?

Thanks,

Siegfried

Reply via email to