didess has asked for the wisdom of the Perl Monks concerning the following question:
Hi to all !
when reading doc by "perldoc -f ref" I get, this sentence :
So, for testing purpose, I tried this code :The result "Regexp" indicates that the argument is a re +gular expression resulting from "qr//".
#!/usr/bin/perl my $regX = qx /\.pm/ ; printf ("type of regX=%s\n", ref(\$regX));
And I get "type of regX=SCALAR" instead of the waited "Regexp".
What did I do wrong ??
Some infos:
Perl 5.12.3 from ActiveState
I tried {/\.pm/} with no more success.
Thanks to all !
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ref and qx
by ikegami (Patriarch) on May 06, 2011 at 05:40 UTC | |
by Anonymous Monk on May 06, 2011 at 12:13 UTC |