List Info

Thread: Fun Perl question




Fun Perl question
country flaguser name
United Kingdom
2008-02-19 09:04:13
So there's me with this bit of code that's running a bit
slow. I run the
following command:

  perl -MProf
./test.pl

and then follow it with dproffpp to see the results. I'm
then left
scratching my head to work out why I've got "Unable to
open tmon.out" before
spotting my silly mistake.

The fun question is: why did the original command seem to
work?

(I've already worked out the answer, by the way, but it
might be an amusing
puzzle for somebody else.)


RE: Fun Perl question
country flaguser name
United Kingdom
2008-03-04 04:37:56

> So there's me with this bit of code that's running a
bit slow. I run 
> the following command:
>
>  perl -MProf
./test.pl
>
> and then follow it with dproffpp to see the results.
I'm then left
> scratching my head to work out why I've got
"Unable to open tmon.out" 
> before spotting my silly mistake.
>
> The fun question is: why did the original command seem
to work?

And 

	perl -wMProf
./test.pl

cryptically says:

	Useless use of a constant in void context.

More recent development versions of perl would give:

	Useless use of a constant (DProf) in void context.

As of perl33407, "perl -MProf
./test.pl" fails with:

	Invalid module name Prof
with -M option: contains single ':'.

Robin

------------------------------------------------------------
-------
This e-mail and any attachments may contain confidential
and/or
privileged material; it is for the intended addressee(s)
only.
If you are not a named addressee, you must not use, retain
or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No:
2937881
Registered Office: Serco House, 16 Bartley Wood Business
Park,
                   Hook, Hampshire, United Kingdom  RG27
9UY
------------------------------------------------------------
-------


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )