[10737] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4336 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 1 18:07:34 1998

Date: Tue, 1 Dec 98 15:00:17 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 1 Dec 1998     Volume: 8 Number: 4336

Today's topics:
    Re: Active State and Package Manager not working <indy@NOSPAMdemobuilder.com>
    Re: Breaking a string into fixed lengths steve.cooke@wmc.com.au
    Re: GuestBook on NT with Blat <cbeatson@mail.ci.lubbock.tx.us>
    Re: localtime () - perl's  bug ? (David Formosa)
    Re: Memory in Perl (Erik)
    Re: Memory in Perl (Ilya Zakharevich)
        Perl "Expert" for Global Remove E-mail List <pplnet1@connectnet.com>
    Re: Perl "Expert" for Global Remove E-mail List (Tad McClellan)
    Re: Perl "Expert" for Global Remove E-mail List (Erik)
    Re: Perl on Solaris 2.5.1 (#!/opt/LWperl/bin)? (Timothy J. Lee)
    Re: Perl on Solaris 2.5.1 (#!/opt/LWperl/bin)? (Martien Verbruggen)
    Re: perlcc on Win NT <indy@NOSPAMdemobuilder.com>
    Re: Strip and add, perl style (Martien Verbruggen)
    Re: Strip and add, perl style (Mark D.)
    Re: Terribly simply perl question about qw() (James Weisberg)
    Re: Terribly simply perl question about qw() <jdf@pobox.com>
    Re: Terribly simply perl question about qw() (James Weisberg)
    Re: Terribly simply perl question about qw() (Sam Holden)
        trouble passing value of variable <hairball@erols.com>
    Re: Why is "... @foo ..." occasionally a syntax error? (Tad McClellan)
    Re: Why is "... @foo ..." occasionally a syntax error? <jc@eddie.mit.edu>
    Re: Why is "... @foo ..." occasionally a syntax error? (Erik)
    Re: Why is "... @foo ..." occasionally a syntax error? <jc@eddie.mit.edu>
        Win32::ODBC on web trouble <tom@webexpert.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 1 Dec 1998 17:21:34 -0500
From: "Indy" <indy@NOSPAMdemobuilder.com>
Subject: Re: Active State and Package Manager not working
Message-Id: <741q5p$9lm$1@nntp2.uunet.ca>

It works for me.  Maybe a file is corrupted.  Try reinstalling

Indy
--
www.perl2exe.com
Tools for Web Programmers


Bill Moseley wrote in message <36623212$0$227@nntp1.ba.best.com>...
>I'm running Build 506 of Active State Perl on a Win 95 machine.
>
>When I run the Perl Package Manager, ppm, with any command I receive the
>following:
>
>junk after document element at line 2, column 0, byte 27 at
>D:\PERL\site\lib/XML/Parser.pm line 118
>
>I'm a bit lost on what to look at next.  I've looked at Parser.pm, and
don't
>see any problem, though I'm not exactly sure that's what the error message
is
>saying.
>
>
>
>
>--
>( Please CC: by email if not too much trouble )
>--------------
>Bill Moseley
>moseley@best.com
>




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

Date: Tue, 01 Dec 1998 21:57:25 GMT
From: steve.cooke@wmc.com.au
Subject: Re: Breaking a string into fixed lengths
Message-Id: <741oo2$6c0$1@nnrp1.dejanews.com>



> >  Any comments on my code would be very welcome.
>
> It looks like you're a C programmer new to Perl :-) Which is not meant
> to be a put-down at all, many of us started there.
>
> The way I'd do what you ask for is with a regular expression:

Thankyou to everyone who replied to my request for comments on my coding
style. I *am* a recent convert to Perl and all comments I received have been
taken on board for mulling over!

Steve Cooke.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 1 Dec 1998 15:58:38 -0600
From: "Chris Beatson" <cbeatson@mail.ci.lubbock.tx.us>
Subject: Re: GuestBook on NT with Blat
Message-Id: <741p2a$j0f$1@spider.ci.lubbock.tx.us>

>Our existing GuestBook works on an NT using postmail (I think) but the new
>server only has blat and I don't know how to port it.

>From your cgi program,  just call the blat command to send the mail.. e.g

$cmd="blat -f $tempfile -t someone\@somewhere -f someone\@somewhere -s
subject";
$i=(system($cmd));

Hope this helps
CB







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

Date: 1 Dec 1998 22:35:28 GMT
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: localtime () - perl's  bug ?
Message-Id: <slrn768rpg.ugc.dformosa@godzilla.zeta.org.au>

In article <MPG.10cdf9fa399085cf98989f@nntp.hpl.hp.com>, Larry Rosler wrote:

[...]

>In article <slrn768cf4.d93.dformosa@godzilla.zeta.org.au> on 1 Dec 1998 
>18:13:56 GMT, David Formosa <dformosa@zeta.org.au> says...
>> In article <MPG.10cdb35d37c2bddf98993a@nntp.hpl.hp.com>, Larry Rosler wrote:
>...
>> >"The CONTEXT for the two-digit disambiguation is the Unix epoch, which 
>> >will do perfectly well for almost all of our programs." [...]
>> As my Grandmother is still alive I don't think she counts as
>> historical.  [...]

>The snippet I showed is a function on the year.  Functions have domains 
>for their arguments and ranges for their values, which are single-valued 
>mappings of the arguments.  In this case the domain of the argument is 
>the set of non-negative integers, and the range of the values is the set 
>of years for which the Unix epoch is valid.

Yes your function works, however I'm attacking your assumptions.  I
don't beleave that the unix epoch is in anyway usefull.  The question
I would ask you is "What problem are you trying to solve."

-- 
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.



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

Date: 1 Dec 1998 22:03:37 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Memory in Perl
Message-Id: <741p3p$adj$4@news.cyberhighway.net>

[Posted and mailed]

In article <36646037.C0EC09D8@cornell.edu>,
        Jon Peck <jmp35@cornell.edu> writes:
>  - Does Perl delete/clean a variable when it sees it will no longer be
> needed in the rest of the script?

Perl will reclaim the memory used by a variable when the last reference to
it is either deleted, undef'd, or goes out of scope.

>  - If not, will my()'d variables be cleared when the subroutine/block
> exits, or still exist and just not be acessible? How about local()?

my() declares a variable to be local, hence the memory used will be reclaimed
by Perl when the subroutine exits.  local(), on the other hand, just says
that a global variable has a local value.  So, although the actual value
assigned to the local variable does not exist outside the scope of
the subroutine, the variable itself does exist.

>  - Is there any forcable garbage-collection?

Yes, undef or delete() variables that you no longer intend to use.

>  - Is re-using temp variables a good solution?  How about setting vars
> to null?

re-using is a good idea.  undef'ing after use is also a good idea.  I don't
think that setting a variable to null will help, because the variable
is still defined, it just holds the value null.

>  - Does reset() have anything to do with this?

No, reset() just sets the variables to their "pristine state", which I assume
means null, but they remain defined.

An important consideration is to realize there is a difference between
a variable and the memory space taken by a variable's value.  This is
important when you have references to a variable, because undef'ing
the variable in that case will not free up the memory used by the variable's
value, because the references still exist and are still pointing to it.

--
Erik Nielsen, Cyberhighway Internet Services NOC
Just don't make the '9' format pack/unpack numbers...  :-)
             -- Larry Wall in <199710091434.HAA00838@wall.org>


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

Date: 1 Dec 1998 22:52:39 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Memory in Perl
Message-Id: <741rvn$mh7$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Erik
<eln@cyberhighway.net>],
who wrote in article <741p3p$adj$4@news.cyberhighway.net>:
> [Posted and mailed]
> 
> In article <36646037.C0EC09D8@cornell.edu>,
>         Jon Peck <jmp35@cornell.edu> writes:
> >  - Does Perl delete/clean a variable when it sees it will no longer be
> > needed in the rest of the script?
> 
> Perl will reclaim the memory used by a variable when the last reference to
> it is either deleted, undef'd, or goes out of scope.

Wrong.

> >  - If not, will my()'d variables be cleared when the subroutine/block
> > exits, or still exist and just not be acessible? How about local()?
> 
> my() declares a variable to be local, hence the memory used will be reclaimed
> by Perl when the subroutine exits. 

Wrong.

> local(), on the other hand, just says
> that a global variable has a local value.  So, although the actual value
> assigned to the local variable does not exist outside the scope of
> the subroutine, the variable itself does exist.

local() - in the current implementation - actually releases the memory
associated with the substituted value.

> An important consideration is to realize there is a difference between
> a variable and the memory space taken by a variable's value.  This is
> important when you have references to a variable, because undef'ing
> the variable in that case will not free up the memory used by the variable's
> value, because the references still exist and are still pointing to it.

Wrong.

Hope this helps,
Ilya


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

Date: Tue, 01 Dec 1998 14:02:26 -0800
From: Jeffery DeMarco <pplnet1@connectnet.com>
Subject: Perl "Expert" for Global Remove E-mail List
Message-Id: <36646772.27208881@connectnet.com>

Contract work - Part Time - Tele-Commute

I am looking for an 'OFF THE SHELF"
Perl Script to be used as a 'Global Remove List'
for e-mail addresses.

I need a Perl "expert" to further customize
and integrate onto an NT server.

Looking to contract someone at $25.00 per hour

Thanks, Jeffery



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

Date: Tue, 1 Dec 1998 17:10:26 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl "Expert" for Global Remove E-mail List
Message-Id: <21t147.vi7.ln@flash.net>

Jeffery DeMarco (pplnet1@connectnet.com) wrote:

: I need a Perl "expert" to further customize
: and integrate onto an NT server.

: Looking to contract someone at $25.00 per hour


   Be *very* suspicious of those claiming to be "expert" at that rate.

   That is more a "hobbyist" rate.


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


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

Date: 1 Dec 1998 22:45:15 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Perl "Expert" for Global Remove E-mail List
Message-Id: <741rhr$e2j$2@news.cyberhighway.net>

In article <21t147.vi7.ln@flash.net>,
	tadmc@flash.net (Tad McClellan) writes:
> Jeffery DeMarco (pplnet1@connectnet.com) wrote:
> 
>: I need a Perl "expert" to further customize
>: and integrate onto an NT server.
> 
>: Looking to contract someone at $25.00 per hour
> 
> 
>    Be *very* suspicious of those claiming to be "expert" at that rate.
> 
>    That is more a "hobbyist" rate.

I would need at least 10 times that just for working on an NT server
for any reason ;)

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
If you want to program in C, program in C.  It's a nice language.  I
use it occasionally...   :-)
             -- Larry Wall in <7577@jpl-devvax.JPL.NASA.GOV>


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

Date: Tue, 1 Dec 1998 22:08:08 GMT
From: timlee@netcom.com.DELETE-THIS.BIT (Timothy J. Lee)
Subject: Re: Perl on Solaris 2.5.1 (#!/opt/LWperl/bin)?
Message-Id: <timleeF3B45K.36G@netcom.com>

"Mike Marshall" <removeMike@SinglepointSys.com> writes:
|This package loads into /opt/LWperl.   Perl scripts, in general, have a
|sh-bang line (#!/usr/bin/perl) of /usr/bin/perl, or /usr/local/perl, etc...
|
|I understand that /opt on Solaris 2.5.1 is for optional software, but do
|Administrators leave Perl in /opt?  Does this mean that they change sh-bang
|lines on perl scripts? Or, Is there typically some sort of linking going on
|to connect the two?

I've always put perl in its default /usr/local/bin, but I've always
installed it by compiling it from the source code.

|Any comments regarding the typical slicing of drives could help me out, too.
|Lots of slices or just 2 ( / & swap)?

/ and swap is probably best for very small disks.  But, on larger disks,
it is usually a good idea to separate /var and any data partitions (e.g.
home directories) from /.

A separate /var removes some of the most heavily written places from /
(reducing the chance of corruption of / in a crash) and prevents a
runaway log file from filling up /.  But make sure /var is large enough
(e.g. 200 MB or so), since patch backout files get put there.  You may
further want to make /var/tmp its own partition if the computer is in
a security-sensitive situation (so that users can't stop logging by
filling up /var by writing a huge file in /var/tmp).  If you do that,
be sure to put a limit on the size of /tmp on swap, or make /tmp a
ufs filesystem instead of a tmpfs filesystem on swap.

-- 
------------------------------------------------------------------------
Timothy J. Lee                                                   timlee@
Unsolicited bulk or commercial email is not welcome.             netcom.com
No warranty of any kind is provided with this message.


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

Date: Tue, 01 Dec 1998 22:22:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl on Solaris 2.5.1 (#!/opt/LWperl/bin)?
Message-Id: <o_Z82.31$Fn3.128@nsw.nnrp.telstra.net>

[Followups set to cu.solaris only]

In article <741n0e$fam@sjx-ixn8.ix.netcom.com>,
	"Mike Marshall" <removeMike@SinglepointSys.com> writes:

> This package loads into /opt/LWperl.   Perl scripts, in general, have a
> sh-bang line (#!/usr/bin/perl) of /usr/bin/perl, or /usr/local/perl, etc...
> 
> I understand that /opt on Solaris 2.5.1 is for optional software, but do
> Administrators leave Perl in /opt?  Does this mean that they change sh-bang
> lines on perl scripts? Or, Is there typically some sort of linking going on
> to connect the two?

Depends on your personal preference. I normally install only Solaris
or Sun specific packages in opt. Some people like to install
everything in /opt/local, because they don't want to deal with two
file systems to scale and size, but I do believe that if you prefer
that, you should provide a link from /usr/local to /opt/local.

/opt is pretty Solaris specific, and most other systems use /usr/local
for this sort of stuff. As far as perl is concerned: It belongs in
/usr/local, but again, that's a preference, not a rule. I've seen
it installed in much weirder places.

> Any comments regarding the typical slicing of drives could help me out, too.
> Lots of slices or just 2 ( / & swap)?

Depends on the typical use of your machine, and the number of disks,
and the control you want to have over the various file systems. It
also depends on how your disks are organised (internal, external,
SCSI, IDE, striped disks, etc.)

I normally like to keep at least /usr, /var, /opt and a file system
for user directories separate from the root fs.  In most cases I will
also keep /usr/local separate from /usr, simply because it can get
quite large quite easily. /tmp and swap are a separate issue.

Only two file systems is very likely not the correct setup :). I'd
keep at least the root file system separate from a few others, even
if you're on a very small single disk.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd.       | great height, over water.
NSW, Australia                      | 


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

Date: Tue, 1 Dec 1998 17:17:17 -0500
From: "Indy" <indy@NOSPAMdemobuilder.com>
Subject: Re: perlcc on Win NT
Message-Id: <741ptp$9in$1@nntp2.uunet.ca>

Have a look at www.perl2exe.com

Indy

paj1@my-dejanews.com wrote in message <73rtm5$buv$1@nnrp1.dejanews.com>...
>Hi,
>
>I am trying to build a perl program into a Win32 .exe file which includes
the
>Perl interpreter. This is to make downloading it off my website easy for
non-
>programmers.
>
>I am doing this using PerlCC (part of Perl5.005_02) on WinNT. I've had to
hack
>at the build script somewhat to make it work, but it now builds an
executable.
>
>However, whenever the program tries to access @ARGV, I just get
"Modification
>of a read-only value attempted." and the program stops.
>
>Has anyone else experienced this? Has anyone successfully made such an
>executable on NT?
>
>Thanks,
>
>Paul
>--
>paj@datcon.co.uk           http://cw.oaktree.co.uk/
>    Any opinions expressed are personal and not
>     necessarily representative of my employer
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: Tue, 01 Dec 1998 22:00:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Strip and add, perl style
Message-Id: <pGZ82.23$Fn3.56@nsw.nnrp.telstra.net>

In article <36666128.16691059@news.supernews.com>,
	mark@doddx.com (Mark D.) writes:
> Yes, it doesn't work on my system. I've got 5.04 installed, here's my
> results:
> 
> $cgi_client{'foo'} = "test  test again.gif";
> srand( time() ^ ($$ + ($$ << 15)) );	
> $cgi_client{'foo'} = (int(rand(100000)) + 1) . $cgi_client{'foo'};
> $cgi_client{'foo'} =~ s/[&()\s]|\.html//gi;
> print "$cgi_client{'foo'}\n";	
> __END__
> testtestagain.gif

peculiar.
Are you absolutely sure that this is the code that you execute? You
cut and pasted this?

> perl
$cgi_client{'foo'} = "test  test again.gif";
srand( time() ^ ($$ + ($$ << 15)) );
$cgi_client{'foo'} = (int(rand(100000)) + 1) . $cgi_client{'foo'};
print "$cgi_client{'foo'}\n";
$cgi_client{'foo'} =~ s/[&()\s]|\.html//gi;
print "$cgi_client{'foo'}\n";
__END__
45499test  test again.gif
45499testtestagain.gif
>

No problem at all for me.

> perl -v 
This is perl, version 5.004_04 built for sun4-solaris

Same result with 5.005_02.

And you said that it does put a random number at the end of the
string, when you reverse the arguments to the . operator, right?

Curiouser and curiouser.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: Tue, 01 Dec 1998 22:49:35 GMT
From: mark@doddx.com (Mark D.)
Subject: Re: Strip and add, perl style
Message-Id: <36676d41.19787974@news.supernews.com>

Hi;

This is very strange indeed, but it's now working. I changed nothing,
but I did re-upload the script and reset permissions.

Very odd! But thank you for all your time. All seems ok now!

Mark


On Tue, 01 Dec 1998 22:00:53 GMT, mgjv@comdyn.com.au (Martien
Verbruggen) wrote:

>In article <36666128.16691059@news.supernews.com>,
>	mark@doddx.com (Mark D.) writes:
>> Yes, it doesn't work on my system. I've got 5.04 installed, here's my
>> results:
>> 
>> $cgi_client{'foo'} = "test  test again.gif";
>> srand( time() ^ ($$ + ($$ << 15)) );	
>> $cgi_client{'foo'} = (int(rand(100000)) + 1) . $cgi_client{'foo'};
>> $cgi_client{'foo'} =~ s/[&()\s]|\.html//gi;
>> print "$cgi_client{'foo'}\n";	
>> __END__
>> testtestagain.gif
>
>peculiar.
>Are you absolutely sure that this is the code that you execute? You
>cut and pasted this?
>
>> perl
>$cgi_client{'foo'} = "test  test again.gif";
>srand( time() ^ ($$ + ($$ << 15)) );
>$cgi_client{'foo'} = (int(rand(100000)) + 1) . $cgi_client{'foo'};
>print "$cgi_client{'foo'}\n";
>$cgi_client{'foo'} =~ s/[&()\s]|\.html//gi;
>print "$cgi_client{'foo'}\n";
>__END__
>45499test  test again.gif
>45499testtestagain.gif
>>
>
>No problem at all for me.
>
>> perl -v 
>This is perl, version 5.004_04 built for sun4-solaris
>
>Same result with 5.005_02.
>
>And you said that it does put a random number at the end of the
>string, when you reverse the arguments to the . operator, right?
>
>Curiouser and curiouser.
>
>Martien



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

Date: 1 Dec 1998 16:14:08 -0600
From: chadbour@news.wwa.com (James Weisberg)
Subject: Re: Terribly simply perl question about qw()
Message-Id: <741png$g6l@tekka.wwa.com>

In article <F3B2ID.KIL@world.std.com>,
Andrew M. Langmead <aml@world.std.com> wrote:
>chadbour@news.wwa.com (James Weisberg) writes:
>>	As for your question, I expected variables to be interpolated
>>because in my scanning through some of the libraries, I saw many
>>instances of lines like the following:
>
>>	@EXPORT = qw(&GetOptions $REQUIRE_ORDER $PERMUTE $RETURN_IN_ORDER);
>
>I'm sorry if this is viewed as picking on you, but I find it slightly
>amusing that when you saw what qw() did do, you assumed that you were
>right, the interpreter was wrong, and used as proof to yourself a code
>snippet which you didn't understand. Oh well, I'm told hubris is a
>virtue.

	Hah! I didn't assume I was right; merely that I didn't understand
what was going on, as obviated by the fact I asked a "terribly simple"
perl question. After it was explained to me that qw() wasn't doing
variable interpolation, I quite clearly understood why I misinterpreted
(a feeble pun) the code above. 
	I have actually poked into this group since its very inception
(actually, before that, when there wasn't even a perl group, merely
comp.unix.questions and qw() was an undefined subroutine!). Unfortunately,
I haven't kept up with all the efforts of the Perl developers. Hell, I 
was still using 4.X perl not too long ago or (gasp!) sed/awk. 
	Anyway, like I said, Perl isn't my native language and perhaps
it was selfishness on my part, but at the time, I didn't have any
documentation on what I wanted to know and I knew I'd get a quick
response here. Anyone not wanting to bother with it could have 
clearly skipped past my "terribly simple" question. I'm not offended
by your or anyone else's flames. I've been around long enough to 
grow a permanent asbestos shell.
	But thanks for your time anyway.



-- 
World's Greatest Living Poster


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

Date: 01 Dec 1998 23:21:19 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: chadbour@news.wwa.com (James Weisberg)
Subject: Re: Terribly simply perl question about qw()
Message-Id: <m3soez5wrk.fsf@joshua.panix.com>

chadbour@news.wwa.com (James Weisberg) writes:

> Jonathan Feinberg  <jdf@pobox.com> wrote:
> >chadbour@news.wwa.com (James Weisberg) writes:
> >
> >> Why aren't the variables interpolated inside the qw() function?
> >
> >Why would you expect them to be?  The docs say otherwise.  Perlop:
> 
> 	After receiving many [not-so] cordial invitations to RTFM, I
> thank all who replied. 

"Cordial" means "heartfelt", and does not denote "friendly"!
Therefore, I'd say that most exhortations to RTFM are cordial.

At any rate, I intended no offense.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 1 Dec 1998 16:35:48 -0600
From: chadbour@news.wwa.com (James Weisberg)
Subject: Re: Terribly simply perl question about qw()
Message-Id: <741r04$hfd@tekka.wwa.com>

In article <m3soez5wrk.fsf@joshua.panix.com>,
Jonathan Feinberg  <jdf@pobox.com> wrote:
>chadbour@news.wwa.com (James Weisberg) writes:
>> >chadbour@news.wwa.com (James Weisberg) writes:
>> >> Why aren't the variables interpolated inside the qw() function?
>> >Why would you expect them to be?  The docs say otherwise.  Perlop:
>> 
>> 	After receiving many [not-so] cordial invitations to RTFM, I
>> thank all who replied. 
>
>"Cordial" means "heartfelt", and does not denote "friendly"!

	Yes, I know how to RTFDictionary, thank you. I believe I 
was being sarcastic. 

>Therefore, I'd say that most exhortations to RTFM are cordial.

	Yeah, that 'F' stands for 'Friendly' right?

>At any rate, I intended no offense.

	None taken. You were right to quote the relavent section of 
the perlops man page. Unfortunately, I didn't have access to that
when I posted the question. I suppose that I should have thought
harder about what it means to be a 'literal list'. Where's that
friendly dictionary...


-- 
World's Greatest Living Poster


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

Date: 1 Dec 1998 22:45:08 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Terribly simply perl question about qw()
Message-Id: <slrn768sbk.htf.sholden@pgrad.cs.usyd.edu.au>

On 1 Dec 1998 16:35:48 -0600, James Weisberg <chadbour@news.wwa.com> wrote:
>In article <m3soez5wrk.fsf@joshua.panix.com>,
>Jonathan Feinberg  <jdf@pobox.com> wrote:
>
>>Therefore, I'd say that most exhortations to RTFM are cordial.
>
>	Yeah, that 'F' stands for 'Friendly' right?

Fishing seems to be the currently accepted meaning...


-- 
Sam

You can blame it all on the internet. I do...
	--Larry Wall


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

Date: Tue, 01 Dec 1998 17:26:24 -0600
From: Dale Haines <hairball@erols.com>
Subject: trouble passing value of variable
Message-Id: <36647B20.7217C9B9@erols.com>

I am not having any luck passing the value of a variable from my html
document to a Perl script using JavaScript.

I've tried including the following in the <head> portion of my html
document.

<script language="JavaScript" src="/cgi-bin/clbanner.pl?t_var"></script>

where t_var is a variable.

Similarly with something like
<script language="JavaScript"
src="/cgi-bin/clbanner.pl?document.URL"></script>

In the Perl script I get "t_var" and "document.URL", not their values.
There has to be a way to pass the values, but I can't figure it out.
Maybe
the trouble is with "?" but src="/cgi-bin/clbanner.pl t_var" does not
work
either.

Any help on this will be greatly appreciated.  Thanks.

Dale Haines

p.s.  I can not use a form with hidden attributes to do this.





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

Date: Tue, 1 Dec 1998 16:57:41 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Why is "... @foo ..." occasionally a syntax error?
Message-Id: <59s147.6d7.ln@flash.net>

John Chambers (jc@eddie.mit.edu) wrote:
: A long stint of digging thru TFM and TFFAQ should surely have
: discovered this one, but if it's there, I can't guess the right
: keywords, so I'll break down and ask ...

: My code has lots and lots of examples of using an array inside
: a string, as in "... @foo ...", and it almost always does just
: what TFM says:  It interpolates the values of the array's values,
: separated by the $" string. But I just spent most of a day trying
: to find why a subprocess of a of a subprocess of a CGI script was 
: evaporating, and at long last tracked it down to the message:

: In string, @resource now must be written as \@resource at ralsched.pm line 414, near "@resource"


   The 'perldiag' man page says this about that error message:


--------------------
=item In string, @%s now must be written as \@%s

(F) It used to be that Perl would try to guess whether you wanted an
array interpolated or a literal @.  It did this when the string was first
used at runtime.  Now strings are parsed at compile time, and ambiguous
instances of @ must be disambiguated, either by prepending a backslash to
indicate a literal, or by declaring (or using) the array within the
program before the string (lexically).  (Someday it will simply assume
that an unbackslashed @ interpolates an array.)
--------------------


   Can @resource be seen lexically before the offending line?


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


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

Date: Tue, 01 Dec 1998 17:28:51 -0500
From: John Chambers <jc@eddie.mit.edu>
Subject: Re: Why is "... @foo ..." occasionally a syntax error?
Message-Id: <36646DA3.B144CD74@eddie.mit.edu>

Erik wrote:
> 
> In article <36645C96.430B1AA3@eddie.mit.edu>,
>         John Chambers <jc@eddie.mit.edu> writes:
> > This was a fatal syntax error.  Here's the offending line:
> >
> >       $extra = "@resource" if ($typ eq 'lab');
> 
> Interesting...the only way I'm able to reproduce this error is if @resource
> is not defined at this point.  Is this perhaps in a part of the code where
> @resource is out of scope?  Maybe @resource is a my() variable in another
> block, and is not inherited by this block?  Perhaps it's declared local in
> another block?  When you use the join() syntax you describe below, does
> $extra contain anything?  list values?  the empty string?
> 
> Perl will correctly interpolate "@array", unless it cannot find
> a variable anywhere called @array, in which case it assumes you mean the
> literal "@" character, followed by the literal string "array", and advises
> you that the "@" character needs to be escaped to print.
> 
> > There doesn't seem anything special here.  @resource has been
> > used happily by the code, and things like $resource[1] give the
> > correct value.  $typ is a char string (sometimes 'lab' and at
> 
> When does $resource[1] give the correct value?  Within the same block?
> What does print "$resource[1]" give you if it's placed immediately
> above the assignment statement?

All this seems rather irrelevant, because @resource is created at
run time, and the above error happens during compilation.  It is a
fatal error, and the program dies at the point that the instruction
is read in.  (It's inside a require.)

I can't tell you what the value of $resource[1] is, because the
program doesn't get run at all.

I thought I made it clear that this was a fatal *syntax* error,
and the program dies at the point that perl reads in the line.


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

Date: 1 Dec 1998 22:43:12 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Why is "... @foo ..." occasionally a syntax error?
Message-Id: <741re0$e2j$1@news.cyberhighway.net>

In article <36646DA3.B144CD74@eddie.mit.edu>,
	John Chambers <jc@eddie.mit.edu> writes:
> I can't tell you what the value of $resource[1] is, because the
> program doesn't get run at all.
> 
> I thought I made it clear that this was a fatal *syntax* error,
> and the program dies at the point that perl reads in the line.

So comment the blasted thing out, and put the print statement where that
line would have been executed.
I thought it would have been obvious to disable the offending line before
testing the visibility of @resource at that point in the code.
This isn't rocket science.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
On the plus side, it's a lot easier in general to find /usr/include than cpp.
             -- Larry Wall in <199809041612.JAA05556@wall.org>


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

Date: Tue, 01 Dec 1998 17:45:19 -0500
From: John Chambers <jc@eddie.mit.edu>
Subject: Re: Why is "... @foo ..." occasionally a syntax error?
Message-Id: <3664717F.636DB91@eddie.mit.edu>

Martien Verbruggen wrote:
> 
> In article <36645C96.430B1AA3@eddie.mit.edu>,
>         John Chambers <jc@eddie.mit.edu> writes:
> 
> > In string, @resource now must be written as \@resource at ralsched.pm line 414, near "@resource"
> 
> # perldoc perldiag
> [snip]
>      In string, @%s now must be written as \@%s
>          (F) It used to be that Perl would try to guess whether
>          you wanted an array interpolated or a literal @.  It did
>          this when the string was first used at runtime.  Now
>          strings are parsed at compile time, and ambiguous
>          instances of @ must be disambiguated, either by
>          prepending a backslash to indicate a literal, or by
>          declaring (or using) the array within the program before
>          the string (lexically).  (Someday it will simply assume
>          that an unbackslashed @ interpolates an array.)
> [snip]
> 
> You say that @resource has been happily used by the code, but are you
> sure of that? In any case, it is never a bad idea to run with 'use
> strict' and to declare all your variables. if you do, you shouldn't
> see this message.

Hmmm ... I wonder how one goes about declaring an array in perl.
I don't seem to recall every running across the syntax of an array
declaration.  I've always created them at run-time by statements:
   @foo = ();
or whatever.  This is certainly not a declaration; it's an executable
assignment statement.  Digging around in TFM, I do find a few uses
of the term "declaration", but I don't seem to find a definition of
it.  Where is it hidden?  Is it some sort of metaphor for something
that isn't really a declaration?

Note that I get the error while perl is reading in the code (via
a require command); it is a fatal *syntax* error, and the process
evaporates without returning from the require.  So the program hasn't
assigned anything to @resource yet, because it hasn't gotten past
the initial requires.  Does this mean that there has to be some
sort of use of @resource before the require?  I've never done that
with any arrays before, in quite a lot of years of programming in
perl.  I've almost always put the requires (or uses) at the very
beginning, and it seems to (usually) work.  If some sort of declaration
is needed for @foo to work inside "", then the zillions of uses of
this construct in my code should all bomb, and most of them work just
fine.  I do this inside verbose messages all over the place.

Just what is the rule here?  (And what's a "declaration"? I thought
that one of the great things about perl is that it didn't have or
need them. ;-)


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

Date: Tue, 01 Dec 1998 22:07:02 GMT
From: Tom Crofton <tom@webexpert.net>
Subject: Win32::ODBC on web trouble
Message-Id: <36646888.C93F64A6@webexpert.net>

I have a program that uses the Win32::ODBC module to access an SQL
server, and although it runs just fine from DOS, when you try to run it
off a webpage, it halts somewhere while accessing the module.  (scripts
that
don't use other modules and dll's run OK).  What am I doing wrong?

thanks
-tom









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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4336
**************************************

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