[13922] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

No subject found in mail header

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 10 17:48:03 1999

Date: Mon, 8 Nov 1999 13:18:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942095901-v9-i1318@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 8 Nov 1999     Volume: 9 Number: 1318

Today's topics:
        Turn offline mode OFF in CGI.pm ?? mlynn1@progressive.com
    Re: Turn offline mode OFF in CGI.pm ?? <gellyfish@gellyfish.com>
    Re: Turn offline mode OFF in CGI.pm ?? <moseley@best.com>
    Re: Turn offline mode OFF in CGI.pm ?? <jeff@vpservices.com>
        tutorial or help on HTML parser <philippe.d.oreyeNOphSPAM@iname.com.invalid>
        Use of uninitialized value...? (Neil Cherry)
    Re: Use of uninitialized value...? <moseley@best.com>
    Re: Use of uninitialized value...? (Tad McClellan)
    Re: Use of uninitialized value...? (Neil Cherry)
    Re: Use of uninitialized value...? (Neil Cherry)
        Using C++, I Whould did "cout << &var" to see the addre <landim2NOlaSPAM@brhs.com.br.invalid>
    Re: Using C++, I Whould did "cout << &var" to see the a lee.lindley@bigfoot.com
    Re: Using C++, I Whould did "cout << &var" to see the a (Peter Scott)
    Re: Using C++, I Whould did "cout << &var" to see the a <gellyfish@gellyfish.com>
    Re: Web based email program <bertdevries@usa.net>
    Re: Weird uninitailized value <gellyfish@gellyfish.com>
    Re: Weird uninitailized value (Kragen Sitaker)
    Re: Weird uninitailized value (Abigail)
    Re: what is SHTML ? <rl3s@netcom19.netcom.com>
    Re: what is SHTML ? <gellyfish@gellyfish.com>
        what is the difference between my() and local()? (Markus Svilans)
    Re: what is the difference between my() and local()? <jeffp@crusoe.net>
    Re: what is the difference between my() and local()? (Tad McClellan)
    Re: what is the difference between my() and local()? (Kragen Sitaker)
    Re: Which Search engine script? (Paul Alves)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 05 Nov 1999 15:56:56 GMT
From: mlynn1@progressive.com
Subject: Turn offline mode OFF in CGI.pm ??
Message-Id: <7vuunm$qrf$1@nnrp1.deja.com>

The objective of the following script is to be able to accept passed
input parameters from whether run fom the command line or from an http
request.  I'd like to use the standard libraries as much as is possible
(CGI.pm, etc.).  Of course, because I'm using CGI.pm, as soon as I run
this from the line, I get prompted:
(offline mode: enter name=value pairs on standard input)

 ... obvious I don;t want this ... I'd rather pass the options fom the
line ...  thoughts?  Is there any way to turn the 'offline mode' off
even when running form the line??

use CGI ;
use Getopt::Long;

$cgi = new CGI ;

GetOptions("src:s" => \$src_root,
	   "dest:s" => \$dest_root,
	   "config:s" => \$config_file
	   );

if ( $cgi->param('src_root') &&
     $cgi->param('dest_root') &&
     $cgi->param('config_file')
	)	{
	$src_root = $cgi->param('src_root') ;
	$dest_root = $cgi->param('dest_root') ;
	$config_file = $cgi->param('config_file');
	$RequestType='cgi';
}
elsif ($src_root && $dest_root && $config_file) {
	$RequestOrig = 'line' ;
}
else {
	$RequestOrig = 'def';
	$src_root = 'c:\www1' ;
	$dest_root = 'c:\www2';
	$config_file = 'c:\config\1.dat' ;
}


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 5 Nov 1999 16:30:00 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Turn offline mode OFF in CGI.pm ??
Message-Id: <38230608_2@newsread3.dircon.co.uk>

mlynn1@progressive.com wrote:
> The objective of the following script is to be able to accept passed
> input parameters from whether run fom the command line or from an http
> request.  I'd like to use the standard libraries as much as is possible
> (CGI.pm, etc.).  Of course, because I'm using CGI.pm, as soon as I run
> this from the line, I get prompted:
> (offline mode: enter name=value pairs on standard input)
> 

Read about the -nodebug 'pragma' in the CGI.pm documentation ...

/J\
-- 
"Virtual reality wouldn't be this wet" - Lucas, Seaquest DSV


------------------------------

Date: Fri, 5 Nov 1999 08:46:57 -0800
From: Bill Moseley <moseley@best.com>
Subject: Re: Turn offline mode OFF in CGI.pm ??
Message-Id: <MPG.128ca9d7b06d7a0198984b@nntp1.ba.best.com>

mlynn1@progressive.com (mlynn1@progressive.com) seems to say...
> The objective of the following script is to be able to accept passed
> input parameters from whether run fom the command line or from an http
> request.  I'd like to use the standard libraries as much as is possible
> (CGI.pm, etc.).  Of course, because I'm using CGI.pm, as soon as I run
> this from the line, I get prompted:
> (offline mode: enter name=value pairs on standard input)
> 
> ... obvious I don;t want this ... I'd rather pass the options fom the
> line ...  thoughts?

Sure.  Read the documentation.

perldoc CGI

Look for the section called PRAGMAS



-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


------------------------------

Date: 5 Nov 1999 17:45:47 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Turn offline mode OFF in CGI.pm ??
Message-Id: <3823178F.7E8A744D@vpservices.com>

mlynn1@progressive.com wrote:
> 
> Of course, because I'm using CGI.pm, as soon as I run
> this from the line, I get prompted:
> (offline mode: enter name=value pairs on standard input)
> 
> ... obvious I don;t want this

You can turn it off permanently for a given script with the CGI.pm
pragma -nodebug.  Or, if you only want to turn it off temporarily (e.g.
sometimes you want to feed in params from the command line and sometimes
you don't), you can just invoke the script with a dummy param, e.g.:

	perl scriptname		
		produces the offline mode option
		parses params if you enter them, doesn't if you don't

	perl scriptname x
		does not produce the offline mode option
		does not parse params

        perl scriptname key1=val1&key2=val2
		does not produce the offline mode option
		parses params

-- 
Jeff


------------------------------

Date: Mon, 08 Nov 1999 07:12:18 -0800
From: Philippe <philippe.d.oreyeNOphSPAM@iname.com.invalid>
Subject: tutorial or help on HTML parser
Message-Id: <0a0133f8.8f2ee231@usw-ex0102-012.remarq.com>

Hello,

I want to generate the TOC(table of content) of HTML documents from the
'H' tags, viz <H1>, <H2>, <H3>, ...

Of course, I could use regular exp to do this, but as there is the
HTML::parser and XML::parser, it's better to learn how to use them.

Could anyone prodive an URL where I could find an clear explanation,
because I haven't really understood how to use the start, end, text
method. Actually, if somebody could just show how to extract the text
content between some tag, it would be sufficient.

ex: <H1 ALIGN="CENTER">this is a H1 title</H1>

Thanks,



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



------------------------------

Date: Sun, 07 Nov 1999 14:03:30 GMT
From: njc@dmc.uucp (Neil Cherry)
Subject: Use of uninitialized value...?
Message-Id: <slrn82b1j7.cfh.njc@dmc.uucp>

I'm using Expect.pm (and the other proper modules), I run my code as
follows:

    perl -w ./load.pl ~/drive/hcs/events.bin diane hcsd

I am puzzled on how to avoid this error message:

    Use of uninitialized value at ./load.pl line 81.

Here is the code snippet (I've added lin numbers)

76:    $hcsd_session->expect(5, '-re', '^\x5e\r\n',
77:			        '-re', '^\x23\r\n',
78:                             '-re', '^\x40\r\n' )||printf " [ X ] ";
79:    $t = $hcsd_session->exp_match_number();
80:
81:    if (undef($t)) {
82:      print " t is undef'd "; # not so good
83:	 $t = 0;
84:    }

-- 
Linux Home Automation           Neil Cherry             ncherry@home.net
http://members.home.net/ncherry                         (Text only)
http://meltingpot.fortunecity.com/lightsey/52           (Graphics GB)



------------------------------

Date: Sun, 7 Nov 1999 06:45:53 -0800
From: Bill Moseley <moseley@best.com>
Subject: Re: Use of uninitialized value...?
Message-Id: <MPG.128f307866f62d21989853@nntp1.ba.best.com>

Neil Cherry (njc@dmc.uucp) seems to say...
> 
>     Use of uninitialized value at ./load.pl line 81.
> 
> Here is the code snippet (I've added lin numbers)
> 
> 81:    if (undef($t)) {

perldoc -f undef
perldoc -f defined


-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


------------------------------

Date: Sun, 7 Nov 1999 04:49:06 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Use of uninitialized value...?
Message-Id: <slrn82aioi.k20.tadmc@magna.metronet.com>

On Sun, 07 Nov 1999 14:03:30 GMT, Neil Cherry <njc@dmc.uucp> wrote:

>I am puzzled on how to avoid this error message:
>
>    Use of uninitialized value at ./load.pl line 81.
>
>Here is the code snippet (I've added lin numbers)
>

>81:    if (undef($t)) {


   unless (defined $t) {


>82:      print " t is undef'd "; # not so good
>83:	 $t = 0;
>84:    }

-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Sun, 07 Nov 1999 23:06:42 GMT
From: njc@dmc.uucp (Neil Cherry)
Subject: Re: Use of uninitialized value...?
Message-Id: <slrn82c1f6.1j9.njc@dmc.uucp>

On Sun, 7 Nov 1999 06:45:53 -0800, Bill Moseley wrote:
>Neil Cherry (njc@dmc.uucp) seems to say...
>> 
>>     Use of uninitialized value at ./load.pl line 81.
>> 
>> Here is the code snippet (I've added lin numbers)
>> 
>> 81:    if (undef($t)) {
>
>perldoc -f undef

DOH!

>perldoc -f defined

OK so that's the one I really wanted, I really have to read the docs
more closely.

Thanks!

-- 
Linux Home Automation           Neil Cherry             ncherry@home.net
http://members.home.net/ncherry                         (Text only)
http://meltingpot.fortunecity.com/lightsey/52           (Graphics GB)



------------------------------

Date: Sun, 07 Nov 1999 23:07:34 GMT
From: njc@dmc.uucp (Neil Cherry)
Subject: Re: Use of uninitialized value...?
Message-Id: <slrn82c1gq.1j9.njc@dmc.uucp>

On Sun, 7 Nov 1999 04:49:06 -0500, Tad McClellan wrote:
>On Sun, 07 Nov 1999 14:03:30 GMT, Neil Cherry <njc@dmc.uucp> wrote:
>
>>I am puzzled on how to avoid this error message:
>>
>>    Use of uninitialized value at ./load.pl line 81.
>>
>>Here is the code snippet (I've added lin numbers)
>>
>
>>81:    if (undef($t)) {
>
>
>   unless (defined $t) {
>
>
>>82:      print " t is undef'd "; # not so good
>>83:	 $t = 0;
>>84:    }

Thanks, I really have to read the docs more closely.

-- 
Linux Home Automation           Neil Cherry             ncherry@home.net
http://members.home.net/ncherry                         (Text only)
http://meltingpot.fortunecity.com/lightsey/52           (Graphics GB)



------------------------------

Date: Sat, 06 Nov 1999 08:52:34 -0800
From: Landim <landim2NOlaSPAM@brhs.com.br.invalid>
Subject: Using C++, I Whould did "cout << &var" to see the address of a var. And using PERL???
Message-Id: <2f9de4be.6e44e2b6@usw-ex0103-019.remarq.com>

Hi all...


    I have a scalar "$" variable in perl that i want to see
their addres.
    In C++, i used to do " cout << & var", and using perl?
    How can i do that?
    How can i see the addres of a variable scalar , or a
hash, or an array?




* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


------------------------------

Date: 6 Nov 1999 18:14:58 GMT
From: lee.lindley@bigfoot.com
Subject: Re: Using C++, I Whould did "cout << &var" to see the address of a var. And using PERL???
Message-Id: <801r72$ir1$1@rguxd.viasystems.com>

Landim <landim2NOlaSPAM@brhs.com.br.invalid> wrote:
:>    I have a scalar "$" variable in perl that i want to see
:>their addres.
:>    In C++, i used to do " cout << & var", and using perl?
:>    How can i do that?
:>    How can i see the addres of a variable scalar , or a
:>hash, or an array?

Why do you want to see the address?  You don't plan on doing
anything with it do you?

Here is one way.

rgsun40{ltl}ksh: perl -de '$x = 42;
> $x++;'

Loading DB routines from perl5db.pl version 1.0402
Emacs support available.

Enter h or `h h' for help.

main::(-e:1):   $x = 42;
  DB<1> n
main::(-e:2):   $x++;
  DB<1> x \$x
0  SCALAR(0xce534)
   -> 42

#------- OR ---------------

perl -e '$x=42; print \$x;'
SCALAR(0xcd3dc)

I don't recall reading that the value in SCALAR(0xcd3dc) is actually
a memory address, but it looks like one.  It could just as easily be
just another name (or an offeset) that is used to look up a real
address somewhere.  It is an implementation detail that I don't think
I need to know to write Perl code.  If I did need to know that,
`perldoc perlguts` would be the place I would look first.

You aren't going to try to do anything with the address are you?

`perldoc perlref` may prove helpful for whatever you are really
trying to do.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


------------------------------

Date: 6 Nov 1999 18:32:31 GMT
From: psl@euclid.jpl.nasa.gov (Peter Scott)
Subject: Re: Using C++, I Whould did "cout << &var" to see the address of a var. And using PERL???
Message-Id: <801s7v$phh@netline.jpl.nasa.gov>

In article <2f9de4be.6e44e2b6@usw-ex0103-019.remarq.com>, Landim <landim2NOlaSPAM@brhs.com.br.invalid> writes:
>     I have a scalar "$" variable in perl that i want to see
> their addres.
>     In C++, i used to do " cout << & var", and using perl?
>     How can i do that?
>     How can i see the addres of a variable scalar , or a
> hash, or an array?

There is absolutely no value to seeing the address a variable is stored
at by perl.

For entertainment value only:

print \$scalar, \@array, \%hash;

Since there's nothing you can do with the address it prints there's no
guarantee it isn't lying, of course...

-- 
This is news.  This is your      |  Peter Scott
brain on news.  Any questions?   |  (psl@euclid.jpl.nasa.gov)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


------------------------------

Date: 6 Nov 1999 17:46:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Using C++, I Whould did "cout << &var" to see the address of a var. And using PERL???
Message-Id: <801pho$b9a$1@gellyfish.btinternet.com>

On Sat, 06 Nov 1999 08:52:34 -0800 Landim wrote:
> 
>     I have a scalar "$" variable in perl that i want to see
> their addres.
>     In C++, i used to do " cout << & var", and using perl?
>     How can i do that?
>     How can i see the addres of a variable scalar , or a
> hash, or an array?
> 

The question is irrelevant as Perl doesnt have pointers like C - you
can have *references* which can be thought of as performing the same
purpose in certain circumstances - though the actual value of a reference
is not really useful except for storing and dereferencing (that is to
get at the object to which it refers).  You cannot address actual memory
locations in Perl.  The stringified version of a reference contains a
indication of what kind of thingy it is a reference to:

gellyfish@gellyfish:/home/gellyfish/clpmtest > perl
$a = 2550;
print \$a,"\n";
SCALAR(0x80d6ed4)


If you want to know about perl references please see the perlref manpage.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Mon, 08 Nov 1999 14:16:39 GMT
From: Bert de Vries <bertdevries@usa.net>
Subject: Re: Web based email program
Message-Id: <806m04$vo0$1@nnrp1.deja.com>

In article <7uv2tr$bm7$1@nnrp1.deja.com>,
  bababozorg@aol.com wrote:
> Hi
>
> does anyone know a good perl/cgi webbased email program like
> yahoo/hotmail?
> the program should ables me to sign up for email address online.
> i am on a vitrual server.
> i have checked the programs like atdot or mailman but they are just a
> pop3 checker, i think they dont able me to create an email address.
>
> Thanks for the help
> Hamed
>
I think that you will find what you're lookinfg for at www.ebizmail.com


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 6 Nov 1999 21:18:06 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Weird uninitailized value
Message-Id: <8025ue$bp0$1@gellyfish.btinternet.com>

On Mon, 1 Nov 1999 11:47:03 -0800 John wrote:
> 
> Use of uninitialized value at combine.prl line 71, <IN4> chunk 20 (or
> whatever the last line of the file is)
> 
>      while (<IN4>) {
>         chomp;
>         $dis{$c} = $_;
>         $c = $c + 1;
>     }
> 

I would say that you probably have a line consisting solely of whatever
the line ending character is.


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 06 Nov 1999 22:24:16 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Weird uninitailized value
Message-Id: <kU1V3.48907$23.1863464@typ11.nn.bcandid.com>

In article <8025ue$bp0$1@gellyfish.btinternet.com>,
Jonathan Stowe  <gellyfish@gellyfish.com> wrote:
>On Mon, 1 Nov 1999 11:47:03 -0800 John wrote:
>> Use of uninitialized value at combine.prl line 71, <IN4> chunk 20 (or
>> whatever the last line of the file is)
>>      while (<IN4>) {
>>         chomp;
>>         $dis{$c} = $_;
>>         $c = $c + 1;
>>     }
>
>I would say that you probably have a line consisting solely of whatever
>the line ending character is.

You're saying $_ = $/; chomp; will leave $_ undef?  It doesn't appear
to with my perl.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: 6 Nov 1999 22:20:51 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Weird uninitailized value
Message-Id: <slrn829vo1.2i1.abigail@alexandra.delanet.com>

Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCCLVIII September
MCMXCIII in <URL:news:8025ue$bp0$1@gellyfish.btinternet.com>:
$$ On Mon, 1 Nov 1999 11:47:03 -0800 John wrote:
$$ > 
$$ > Use of uninitialized value at combine.prl line 71, <IN4> chunk 20 (or
$$ > whatever the last line of the file is)
$$ > 
$$ >      while (<IN4>) {
$$ >         chomp;
$$ >         $dis{$c} = $_;
$$ >         $c = $c + 1;
$$ >     }
$$ > 
$$ 
$$ I would say that you probably have a line consisting solely of whatever
$$ the line ending character is.


No, for two reasons. First, on such a line, chomp returns the empty
string, which is defined. Secondly, after chomping, $_ is only stored,
which will not trigger a warning, even if it's undef.

Perhaps $c is uninitialized? Although that ought to generate 2 warnings.



Abigail
-- 
perl -e 'for (s??4a75737420616e6f74686572205065726c204861636b65720as?;??;??) 
             {s?(..)s\??qq \?print chr 0x$1 and q ss\??excess}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 5 Nov 1999 18:13:04 GMT
From: Zeus Paleologos <rl3s@netcom19.netcom.com>
Subject: Re: what is SHTML ?
Message-Id: <7vv6ng$812$1@nntp8.atl.mindspring.net>

In article <slrn80ogcj.1vv.mgjv@wobbie.heliotrope.home> on 19 Oct 1999 10:01:09 GMT,
 Martien Verbruggen <mgjv@wobbie.heliotrope.home> wrote:
> On 19 Oct 1999 01:16:24 -0500,
> 	Abigail <abigail@delanet.com> wrote:
>> Ally Kwon (ewha95@shinbiro.com) wrote on MMCCXL September MCMXCIII in
>> <URL:news:380BF886.71538C91@shinbiro.com>:
>> ~~ i know what HTML is, but what is SHTML ?
>> ~~ how is it different from HTML ?
>> 
>> 
>> A lot. It has nothing at all to do with HTML. SHTML stands for
>> 
>>    Standford High Throwing Midget League.
>> 
>> Not to be confused with SFTML, the 
>> 
>>    Standford Far Throwing Midget League.

> Please do not encourage people to post offtopic questions to clp.misc.

Don't discourage them either.  Just ignore them.

> If you must answer, at least tell them something nonsensical, 

Like:  Waste bandwidth to combat wasting bandwidth.



------------------------------

Date: 6 Nov 1999 15:53:44 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: what is SHTML ?
Message-Id: <801iu8$b1o$1@gellyfish.btinternet.com>

On 5 Nov 1999 18:13:04 GMT Zeus Paleologos wrote:
> In article <slrn80ogcj.1vv.mgjv@wobbie.heliotrope.home> on 19 Oct 1999 10:01:09 GMT,
>  Martien Verbruggen <mgjv@wobbie.heliotrope.home> wrote:
>> On 19 Oct 1999 01:16:24 -0500,
>> 	Abigail <abigail@delanet.com> wrote:
>>> Ally Kwon (ewha95@shinbiro.com) wrote on MMCCXL September MCMXCIII in
>>> <URL:news:380BF886.71538C91@shinbiro.com>:
>>> ~~ i know what HTML is, but what is SHTML ?
>>> ~~ how is it different from HTML ?
>>> 
>>> 
>>> A lot. It has nothing at all to do with HTML. SHTML stands for
>>> 
>>>    Standford High Throwing Midget League.
>>> 
>>> Not to be confused with SFTML, the 
>>> 
>>>    Standford Far Throwing Midget League.
> 
>> Please do not encourage people to post offtopic questions to clp.misc.
> 
> Don't discourage them either.  Just ignore them.
> 
>> If you must answer, at least tell them something nonsensical, 
> 
> Like:  Waste bandwidth to combat wasting bandwidth.
> 

Nothing to do with Bandwidth - its just like a scorched earth thing - if
people are going to make this group unuseable by posting this crap all
the time then we're just gonna post even more crap so its even more
unuseable and er ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 06 Nov 1999 16:46:29 GMT
From: bh447@freenet.carleton.ca (Markus Svilans)
Subject: what is the difference between my() and local()?
Message-Id: <38245ad4.6339320@news.ncf.carleton.ca>

Hi all,

I just read some posts about some extremely idiotic Perl programmer
who "doesn't even know the difference between my() and local()". In
order to not become like this poor slob, I just wanted to know if
someone could clarify for me the difference between the two.

I've been using local() inside subs to declare local variables (duh!)
but I've also seen my() being used in other spots. What does my() do?

Thanks a lot! (Perl pros: please don't laugh too hard :)

-Markus

--
Rainy days and automatic weapons always get me down.s


------------------------------

Date: Sat, 6 Nov 1999 12:18:24 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: what is the difference between my() and local()?
Message-Id: <Pine.GSO.4.10.9911061216420.4538-100000@crusoe.crusoe.net>

[posted & mailed]

Your question is almost the exact question asked in perlfaq7:

  What's the difference between dynamic and lexical (static) scoping? 
  Between local() and my()?

Look for that heading in perlfaq7, or do this:

  perldoc -q lexical

-- 

  MIDN 4/C PINYAN, USNR, NROTCURPI
  jeff pinyan      japhy@pobox.com
  perl stuff       japhy+perl@pobox.com
  CPAN ID: PINYAN  http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/



------------------------------

Date: Sat, 6 Nov 1999 17:47:38 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: what is the difference between my() and local()?
Message-Id: <slrn829c0a.je0.tadmc@magna.metronet.com>

On Sat, 06 Nov 1999 16:46:29 GMT, Markus Svilans 
   <bh447@freenet.carleton.ca> wrote:


>I just read some posts about some extremely idiotic Perl programmer
>who "doesn't even know the difference between my() and local()". 


   Any Perl programmer who has not at least skimmed all of
   the Frequently Asked Questions once or twice is indeed idiotic.


> In
>order to not become like this poor slob, 


   Too late!     :-)


> I just wanted to know if
>someone could clarify for me the difference between the two.


   Your Question gets Asked Frequently around here.

   You should check to see if there is a Frequently Asked Question
   that mentions both "my" and "local".


>I've been using local() inside subs to declare local variables (duh!)
>but I've also seen my() being used in other spots. What does my() do?


   The general rule is:

      Always use my() unless you can't.

   For new to intermediate Perl programmers, the only place where
   you should but you can't is for Perl's builtin variables.

   So the revised rule is:

      Use local() for builtin variables and my() for everything else.

   By the time you grow past this rule you will know when you
   must go past this rule :-)



>Thanks a lot! (Perl pros: please don't laugh too hard :)

   Use the docs, and we won't.

   He he he.




------------------------------

Date: Sun, 07 Nov 1999 19:35:43 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: what is the difference between my() and local()?
Message-Id: <jwkV3.53792$23.2012205@typ11.nn.bcandid.com>

In article <slrn829c0a.je0.tadmc@magna.metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>   Any Perl programmer who has not at least skimmed all of
>   the Frequently Asked Questions once or twice is indeed idiotic.

Tad, shut the fuck up, eh?  It's one thing to be frustrated that people
don't know about FAQs or don't read them.  It's something else entirely
to go looking for excuses to call people idiots.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Mon, 08 Nov 1999 07:54:22 GMT
From: webmaster@torontoshop.com (Paul Alves)
Subject: Re: Which Search engine script?
Message-Id: <3826813c.35921215@news.internet.look.ca>


atomz.com looks cool... but when you get high traffic it doesnt look
worth it at all...  time to install a custom cgi script...

Other than that atomz.com looks like a real cool service.


On Fri, 29 Oct 1999 07:30:07 GMT, mpthompson@home.net (Mike Thompson)
wrote:

>On Mon, 27 Sep 1999 14:19:24 +0800, "van Weelden" <cim@cim-net.com>
>wrote:
>>I have a homepage with information of different companies. Now I want to =
>>install a search engine on this homepage, but which script is the best =
>>and easy to use? It must be possible to search HTML pages with keywords. =
>>But it must also be possible to look for a specific company name, =
>>country, etc...
>>If you know a good script, let me know.
>
>Give www.atomz.com a try. It is a free search engine service 
>that is very easy to add to any web site.  It is the same search
>service used by some very large high-capacity sites such as
>www.oreilly.com, www.webmonkey.com, and many others, 
>but the same exact search engine is available for free to 
>smaller sites.
>
>Mike Thompson
>



------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 1318
**************************************


home help back first fref pref prev next nref lref last post