Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Returning specific data from a webpage?

Reply
Thread Tools

Returning specific data from a webpage?

 
 
Anno Siegel
Guest
Posts: n/a
 
      07-07-2005
A. Sinan Unur <> wrote in comp.lang.perl.misc:
> Gunnar Hjalmarsson <> wrote in
> news::
>
> > wrote:
> >> A. Sinan Unur wrote
> >>>
> >>> Those should be
> >>> use strict;
> >>> use warnings;
> >>> Case matters in Perl.
> >>> Please read the posting guidelines for this group.
> >>
> >> Sorry, I was following the guidelines but I used the wrong case in
> >> the actual script itself and so copied and pasted wrong. Newbie
> >> mistake (we were all newbies once, remember?)

> >
> > Now you are lying, don't do that!! If you had used wrong cases in the
> > actual script, the program hadn't compiled, and you hadn't talked
> > about "successfully receiving a response page".

>
> The OP might be on Windows where the case insensitive nature of the
> operating system can play nasty tricks on the unsuspecting individual.
> Indeed:
>
> D:\Home\asu1> cat ttt.pl
> #!/usr/bin/perl
>
> use Strict;
> use Warnings;


Same for Mac (OS X or earlier), at least when run on a case-insensitive
file system.

At first sight it looks pretty harmless, after all Perl finds the
intended module, so all is fine. However, a potential import()
method in the module will *not* be found because Perl looks for
->Warnings::import (in the case of "warnings"), where case matters.
This doesn't lead to an error message either (only if parameters were
given).

So the module *has* been loaded, but then some things the code expects
to be done have *not* been done. The resulting situation can be very
confusing.

Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
 
Reply With Quote
 
 
 
 
axel@white-eagle.invalid.uk
Guest
Posts: n/a
 
      07-07-2005
A. Sinan Unur <> wrote:
> Gunnar Hjalmarsson <> wrote in
>>> Sorry, I was following the guidelines but I used the wrong case in
>>> the actual script itself and so copied and pasted wrong. Newbie
>>> mistake (we were all newbies once, remember?)


>> Now you are lying, don't do that!! If you had used wrong cases in the
>> actual script, the program hadn't compiled, and you hadn't talked
>> about "successfully receiving a response page".

>
> The OP might be on Windows where the case insensitive nature of the
> operating system can play nasty tricks on the unsuspecting individual.


It can happen on a MAC OS X HFS+ system as well, with some nasty side effects...

#!/usr/bin/perl

use Strict; # sic!
use Warnings; # sic!

$pi = 3.14159;
printf ("Pi is %0.2f \n", $pie);
__END__

Generates no problems with regard to the use statements.

But neither does it actually implement strict or warnings and the
above snippet will compile and run without any warnings to inform
us:

Pi is 0.00

Axel


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML parsing problem finding a specific element in a specific place mazdotnet ASP .Net 2 10-02-2009 10:07 AM
Parsing DOM to search specific tags with specific custom attribute William FERRERES Javascript 7 07-09-2007 08:11 PM
Is ViwState Page-Specific or UserControl-Specific =?Utf-8?B?SmF2?= ASP .Net 2 08-16-2006 09:30 PM
redirect traffic on specific ip to specific interface mimiseh Cisco 3 06-05-2005 09:14 PM
How do you make sure a frameset is loaded? I'm trying to open a frameset in a new window which shows a specific html page in a specific frame ck388 Javascript 1 09-24-2003 08:32 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57