[22828] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5049 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 27 21:06:04 2003

Date: Tue, 27 May 2003 18:05:07 -0700 (PDT)
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, 27 May 2003     Volume: 10 Number: 5049

Today's topics:
        Advise Needed <deadletters@nabbers.net>
    Re: Advise Needed <usenet@dwall.fastmail.fm>
    Re: Advise Needed (Tad McClellan)
    Re: better way to do this than a hash? <w.koenig@acm.org>
        DBI query to Informix takes 20sec to end (Thomas)
    Re: Doing substitutions in a while loop (while /.../g) <apollock11@hotmail.com>
    Re: Doing substitutions in a while loop (while /.../g) (Tad McClellan)
    Re: Doing substitutions in a while loop (while /.../g) <REMOVEsdnCAPS@comcast.net>
    Re: extracting records in an array <ndouba@chat.carleton.ca>
    Re: how to not cause a file lock? <mgjv@tradingpost.com.au>
        Looking for FormMail with ticket number script <gregatwork@REMOVETHISTOSENDMEMAILhotmail.com>
    Re: Module to decode MS Word documents? (Chris Russell)
    Re: Safe Eval <REMOVEsdnCAPS@comcast.net>
    Re: Sorting hash <noreply@gunnar.cc>
    Re: Sorting hash <ddunham@redwood.taos.com>
    Re: Sorting hash <noreply@gunnar.cc>
        Spreadsheet::Excel  different   bg_color    for differe (Kenjis Kaan)
    Re: Tie module <REMOVEsdnCAPS@comcast.net>
        What is expilcit package name? <bbsouth@bellsouth.net>
    Re: What is expilcit package name? <noreply@gunnar.cc>
    Re: What is expilcit package name? <michael.p.broida@boeing.com>
    Re: What is expilcit package name? (Jay Tilton)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 27 May 2003 23:21:11 GMT
From: "deadletters" <deadletters@nabbers.net>
Subject: Advise Needed
Message-Id: <HpSAa.61$lS2.1153259@news-text.cableinet.net>

Hi there,

    I have just created my first web site and everything in HTML land is
average to good so far.

    Perl however is another matter. My host supports version 5.6.1 of
Perl...but I have not got a clue!!!

I am an average to good programmer in Pascal and that's about your lot. Info
I need is :-

1. Can I get my hands on a free Perl set of software so as to learn the
ropes, if not, whats the best package for a low-end user (as
in...needs/wants a few functions but does not know where to start)
2. If there is a good range to choose from, what should I aim for as a
beginner
3. Any other useful tips you may have

    Please accept apologies if I have posted this request in the wrong
newsgroup, If I have, which group should I go too?...clean replies
only...LOL

Many Regards.....John Kelly




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

Date: Tue, 27 May 2003 23:58:14 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: Advise Needed
Message-Id: <Xns9388CB22A1533dkwwashere@216.168.3.30>

"deadletters" <deadletters@nabbers.net> wrote:

> 1. Can I get my hands on a free Perl set of software so as to learn
> the ropes, if not, whats the best package for a low-end user (as
> in...needs/wants a few functions but does not know where to start)

You can get Perl for your OS here: 
http://www.perl.com/pub/a/language/info/software.html

Since you appear to be using Windows, that will probably lead you to the 
Activestate.com site.

> 2. If there is a good range to choose from, what should I aim for as
> a beginner

I'd suggest getting a copy of Randal Schwartz' "Learning Perl", 
ISBN 0-596-00132-0.

> 3. Any other useful tips you may have

See http://learn.perl.org/

or

http://c2.com/cgi/wiki?PerlLanguage for a variety of viewpoints.


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

Date: Tue, 27 May 2003 19:08:20 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Advise Needed
Message-Id: <slrnbd7vfk.3br.tadmc@magna.augustmail.com>

deadletters <deadletters@nabbers.net> wrote:

>     I have just created my first web site and everything in HTML land is
> average to good so far.
> 
>     Perl however is another matter. My host supports version 5.6.1 of
> Perl...but I have not got a clue!!!


Can you access a command line on the host's machine?

Or are you restricted to running only those Perl programs that
conform to the CGI?

If the later, it does not matter what your host has, because you
should not be learning Perl and CGI stuff at the same time.

Learn Perl first, at home, on your own_ computer, then learn how 
to use Perl for the application-specific (CGI) things.


> I am an average to good programmer in Pascal and that's about your lot. Info
> I need is :-
> 
> 1. Can I get my hands on a free Perl set of software so as to learn the
> ropes, 


Do you mean example code?

If so, be careful where you get it. Don't learn from code that you
got at "just any old website".

There is example code posted here in this newsgroup daily (and if it
is "bad", one of the thousands of other readers will catch it).


> if not, whats the best package for a low-end user (as


"package"? What do you mean?

Do you mean that you want to run Perl on your home computer so
that you can start learning Perl?


> in...needs/wants a few functions but does not know where to start)


Perl is free. There is no "package" to buy. Resist the brainwashing
you've been subjected to.  :-)


> 2. If there is a good range to choose from, what should I aim for as a
> beginner


What you aim for depends on what it is that you want to hit...


> 3. Any other useful tips you may have


Perl is free. Download and install it. 

Assuming you are using Windows at home, click on the little "download"
it the upper-left corner of:

   http://www.activestate.com/Products/ActivePerl/


>     Please accept apologies if I have posted this request in the wrong
> newsgroup, 


Nope. This is the right place.

Spend 10 minutes trying to find the answer yourself and if you
don't find it, then post away!



There are some helpful Posting Guidelines at:

   http://mail.augustmail.com/~tadmc/clpmisc.shtml


There is also a mailing list just for beginners:

   http://lists.perl.org/showlist.cgi?name=beginners



Forget about CGI for now, learn to use Perl first.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 28 May 2003 00:09:41 +0200
From: Winfried Koenig <w.koenig@acm.org>
Subject: Re: better way to do this than a hash?
Message-Id: <3ED3E225.6000102@acm.org>

david wrote:
> 	#If the line contains a token reference
> 	if (/\.TOK\.0/) {
> 		         foreach $key (keys(%uid)) {
>                                 $search = $key;
>                                 $replace = $uid{"$key"};
>                                 s/$search/$replace/g;
> 				#exit foreach once matched
>                                 next;
>                 }
>                 #Next comes here
>                 
>                 s/(DG\-)|(STII\-)|(S\/N\:)//g;
>         }

the foreach loop may be your main problem. Is it possible
to replace the loop with something like:

     s/\b(\w+\.TOK\.0)/ $uid{$1} || $1/eg;

Winfried Koenig



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

Date: 27 May 2003 15:28:40 -0700
From: cfa532@hotmail.com (Thomas)
Subject: DBI query to Informix takes 20sec to end
Message-Id: <530f730d.0305271428.19457a27@posting.google.com>

I used Perl DBI to access Informix IDS 2000 on Solaris 2.8. The query
is a simple SELECT and it gets data from Informix pretty quick.
However it takes up to 20s for the prompt to show up after all data is
displayed, sometime it is quick though. I don't see anything else
wrong other than the long wait. My database is logged.

Thanks a lot,


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

Date: Tue, 27 May 2003 15:03:49 -0700
From: Arvin Portlock <apollock11@hotmail.com>
Subject: Re: Doing substitutions in a while loop (while /.../g)
Message-Id: <bb0ni8$2ham$1@agate.berkeley.edu>

 >What is the most elegant way of performing substitutions if
 >> you're matching patterns in a while loop running through a
 >> big old block of slurped text?
 >> while ($text =~ /<!-- ([^<>]+) -->/g) {
 >>     my $subst_val = pop @array;
 >>     ## Here, somehow replace $1 with $subst_val
 >> }

    $text =~ s/<!-- ([^<>]+) -->/ '<!-- ' . pop(@array) . ' -->' /ge;

Hmmm, so if I want to do something more complicated than
pop ()--much more complicated as is generally the case--I can
use a subroutine:

$text =~ s/<!--([^<>]+)-->/'<!--' . &complicated_sub($1) . '-->'/ge;

This never occurred to me. Thanks! This is a pretty useful tool
for me to be adding to my arsenal.



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

Date: Tue, 27 May 2003 18:48:16 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Doing substitutions in a while loop (while /.../g)
Message-Id: <slrnbd7ua0.3br.tadmc@magna.augustmail.com>

Arvin Portlock <apollock11@hotmail.com> wrote:


[ snip a few generations of quoting (with no attribution) about s///e ]


> I can
> use a subroutine:
> 
> $text =~ s/<!--([^<>]+)-->/'<!--' . &complicated_sub($1) . '-->'/ge;


Yes.

(but don't use the ampersand on function calls, see perlsub.pod)


> This never occurred to me. Thanks! 


Glad I could help.


> This is a pretty useful tool
> for me to be adding to my arsenal.


What? You don't re-read perlop.pod every once in a while?

I do. I find out something I didn't catch the first time each
time I re-read it.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 27 May 2003 19:38:16 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Doing substitutions in a while loop (while /.../g)
Message-Id: <Xns9388D1D95DAF4sdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

tadmc@augustmail.com (Tad McClellan) wrote in 
news:slrnbd7ua0.3br.tadmc@magna.augustmail.com:

> What? You don't re-read perlop.pod every once in a while?
> 
> I do. I find out something I didn't catch the first time each
> time I re-read it.

Geek.  ;-)

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPtQE1WPeouIeTNHoEQIpXACgupUg6+3XQWT8SXKsF0jUGBxqgosAoIJ6
RY1YERHPtbrFImfa4NgDM5w8
=7iQA
-----END PGP SIGNATURE-----


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

Date: 28 May 2003 00:44:30 GMT
From: "Nadeem Douba" <ndouba@chat.carleton.ca>
Subject: Re: extracting records in an array
Message-Id: <bb10pe$6ea$1@driftwood.ccs.carleton.ca>

open(FILE, "<yourfile");
@array = <FILE>;


"Abhi" <abhinospam@kizna.com> wrote in message
news:baut5t$3sl4b$1@ID-147252.news.dfncis.de...
> I need to extract records from a log file, that look like the below
sample.
>
> The idea is to extract the range of lines between the patterns REQUEST
DATA
> and END OF REQUEST DATA as a single array element, and repeat for the next
> record, so that in the end, I can parse and generate a summary of hits per
> hour, per user-agent.
>
> print if m#REQUEST DATA#i .. m#END OF REQUEST DATA#i' does this ofcourse.
> How can I extract the records into an array ?
>
>
> ***                 REQUEST DATA                              ***
> *****************************************************************
> *****************************************************************
>  *****************************
>  *       DateTimeData        *
>  *****************************
>   Arrival Date : 9-Dec-2002
>   Arrival Time : 3:38:13:1
>  *****************************
>  *    End of DateTimeData    *
>  *****************************
>
>  *****************************
>  *       RequestHeaders      *
>  *****************************
>   user-agent : Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90)
>   cache-control : max-age=259200
>  *****************************
>  *   End of RequestHeaders   *
>  *****************************
> *****************************************************************
> *****************************************************************
> ***                 END OF REQUEST DATA                       ***
>
>
> Thanks in advance,
> Abhi
>




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

Date: Tue, 27 May 2003 23:33:10 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: how to not cause a file lock?
Message-Id: <slrnbd7tdm.1lr.mgjv@verbruggen.comdyn.com.au>

On 27 May 2003 18:04:01 GMT,
	Tassilo v. Parseval <tassilo.parseval@rwth-aachen.de> wrote:
> Also sprach peder:
> 
>> i'm working on a project where i will read a text file from a network
>> share (win32). it is crucial that this file doesn't get locked by the
>> perl script since the file is business critical.
>> 
>> how can i prevent this? 

> Perl wont lock any files unless you tell it to do so. Thus if you simply
> open the file without any further concerns, your desired behaviour
> should be the default.

Unless your OS does mandatory locking itself. And when that happens,
you should look at the OS, and not at the programming language, for a
solution.

Many of the MS OSes do mandatory locking. All of the modern ones do.

Martien
-- 
                        | 
Martien Verbruggen      | I'm just very selective about what I accept
Trading Post Australia  | as reality - Calvin
                        | 


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

Date: Wed, 28 May 2003 08:36:16 +0800
From: "gwmbox" <gregatwork@REMOVETHISTOSENDMEMAILhotmail.com>
Subject: Looking for FormMail with ticket number script
Message-Id: <bb10a0$nnt$1@ftp.curtin.edu.au>

Hi

I have been using a formMail script to process basic forms, but I want to
add an automatic number to each submission of the form, like a ticket number
that is unique - it only has to be a sequential number nothing fancy -
anyone know of a script that will do this or how I coudl add this to a
FormMail script.

Thanks

Greg




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

Date: 27 May 2003 16:54:08 -0700
From: c.g.russell@bradford.ac.uk (Chris Russell)
Subject: Re: Module to decode MS Word documents?
Message-Id: <219f0452.0305271554.4d575bef@posting.google.com>

"Stuart Moore" <stjm2@cam.ac.uk> wrote in message news:<bb068p$mdc$1@pegasus.csx.cam.ac.uk>...
> Are there any modules that'd help me grab text from a word document? Doesn't
> matter if it looses all formatting etc but it'll need to get text from
> inside tables, preferably leaving some mark where the table boundaries are
> but not essential. A quick browse of CPAN revealied nothing.
> 
> If not, any suggestions for other languages (preferably ones that are easily
> used for cgi)
> 
> Stuart

If you're doing this on a Win32 machine you might want to consider
using Word to load the documents and having PERL talk directly to Word
vie the Win32::OLE modules.

There's something of an example here:

http://www.wellho.net/solutions/1480965085.html


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

Date: Tue, 27 May 2003 19:36:58 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Safe Eval
Message-Id: <Xns9388D1A0F5E1Esdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

CitFish <cf@<Nooooo spaaammm>phased.co.uk> wrote in 
news:9jd7dvs54bjp5fnbkqbakv6s72i6p8g4ve@4ax.com:

> My questions are:-
> 
> 1) does this make sense or is there a better solution

You may want to go with an object-oriented solution, where every set of 
rules is encapsulated in its own object type, and the part of the program 
that reads the config file creates the appropriate object type, and the 
main part of the program that does the work delegates to these objects.  
But that's a wild guess; it depends on a lot of things in your design.


> 2) how can I restrict the scope of the eval statement to prevent
> malicious code (ie. s/system//g; etc....) or only access a subset of
> program variables

Have you looked at the Safe module?

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPtQEh2PeouIeTNHoEQK8jgCfTeverXr1ICbsNYjbfSjY4ttx5S4AoLbL
/F6y/ziOjIaWbkzO8SJtGCaM
=Kfvf
-----END PGP SIGNATURE-----


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

Date: Wed, 28 May 2003 00:10:51 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Sorting hash
Message-Id: <bb0oe3$4ioad$1@ID-184292.news.dfncis.de>

Darren Dunham wrote:
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>> What did you find? :) Actually, I would say that you caught the 
>> requirements quite well in your first reply.
> 
> I'm thinking it depends on what the OP meant from this sentence.
> 
> "I want the keys to be stored in _the same_ order each time as long
> as the hash isn't changed."
> 
> It seems to me that if "hash isn't changed" means that no changes
> to keys or values are made, then it's rather silly to do another
> sort.

The hash is a tied hash, binding a SDBM file. Please see my try to
clarify in another post.

> You've got one sort, so keeping a copy of it is the way to go.
> Much faster, and you're guaranteed of the same order.  That was how
> I read it originally.

Multiple sorts during the same program execution would be stupid, no
doubt. I was referring to next time the program is executed. The SDBM
file is updated once a day, while its content is printed many times a
day, and each time it's a new program execution.

> I now suppose instead that it was meant that the *keys* of the hash
> haven't changed, even though the values might.

No. Both the keys and the values are unchanged (during 24 hours).

/ Gunnar

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Tue, 27 May 2003 23:46:19 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: Sorting hash
Message-Id: <fNSAa.1324$Bf6.58724473@newssvr14.news.prodigy.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>> You've got one sort, so keeping a copy of it is the way to go.
>> Much faster, and you're guaranteed of the same order.  That was how
>> I read it originally.

> Multiple sorts during the same program execution would be stupid, no
> doubt. I was referring to next time the program is executed. The SDBM
> file is updated once a day, while its content is printed many times a
> day, and each time it's a new program execution.

In which case, you might attempt to also save a copy of the sorted
output and read it when the program runs rather than re-sort?

> No. Both the keys and the values are unchanged (during 24 hours).

The final question I would have is if the tied variable has any effect
on the order of keys().  Certainly it always returns the same list every
time on a normal hash variable.  I assume it does the same when tied to
a database, but that might be database dependent.

-- 
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >


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

Date: Wed, 28 May 2003 02:23:02 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Sorting hash
Message-Id: <bb1065$4guf0$1@ID-184292.news.dfncis.de>

Darren Dunham wrote:
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> 
>>> You've got one sort, so keeping a copy of it is the way to go. 
>>> Much faster, and you're guaranteed of the same order.  That was
>>> how I read it originally.
> 
>> Multiple sorts during the same program execution would be stupid,
>> no doubt. I was referring to next time the program is executed.
>> The SDBM file is updated once a day, while its content is printed
>> many times a day, and each time it's a new program execution.
> 
> In which case, you might attempt to also save a copy of the sorted 
> output and read it when the program runs rather than re-sort?

Well, that would be a possible approach, I guess, but it would require
that I reconsider the structure of that part of the program. There are
reasons why I found it convenient to store the data as a hash.

>> No. Both the keys and the values are unchanged (during 24 hours).
> 
> The final question I would have is if the tied variable has any
> effect on the order of keys().  Certainly it always returns the
> same list every time on a normal hash variable.  I assume it does
> the same when tied to a database, but that might be database
> dependent.

Okay, so I take it that you now, after my clarifications, confirms
that if it was a _normal_ hash, I should expect _the same_ list every
time even without doing a 'stable' sort or adding a secondary sort 
criterion.

Is there possibly anybody who can tell whether the fact that it's a
tied hash (SDBM_File) makes a difference in this respect?

Let me also take this opportunity to thank everyone who have posted in
this thread.

/ Gunnar

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: 27 May 2003 15:22:48 -0700
From: tivolinewbie@canada.com (Kenjis Kaan)
Subject: Spreadsheet::Excel  different   bg_color    for different cell??
Message-Id: <6a8ba9f8.0305271422.26024a90@posting.google.com>

Hello, I just managed to get this module to create a spreadsheet with
a coloured background.  I can change the background colours to different
ones but it seems the background colour takes on only one colour even
though I want each cells in a report to have a different colour.  Any ideas
one how to do this??


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

Date: Tue, 27 May 2003 19:46:32 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Tie module
Message-Id: <Xns9388D2FD0EFB4sdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

cfa532@hotmail.com (Thomas) wrote in 
news:530f730d.0305271336.3b011d6f@posting.google.com:

> Can someone explain the concept of Tie in plain English. I am too dumb
> to figure it out by reading the manual. It sounds like a powerful tool
> though.

It is powerful and useful.

It's actually fairly simple.  In one sentence: tying an object class to a 
variable allows you to access that object class as though it were a simple 
Perl variable (scalar, array, or hash).  As Mark Dominus put it, it's like 
you scooped out the brains of a regular Perl variable and replaced the 
inner workings with your own mechanism.

Tying a scalar is the simplest.  You only need to write three functions, 
TIESCALAR, which creates a new object you define, FETCH, which "retrieves 
the value", or appears to; you decide how. And STORE, which "stores a 
value", you decide how.  You can do anything you want behind the scenes.

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPtQGaGPeouIeTNHoEQLcMQCg/bihNZw1CR5vvf1150PUm6cdmZAAnAov
CGeVEqJp0YeBfieNB/d1NvMr
=Iysi
-----END PGP SIGNATURE-----


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

Date: Tue, 27 May 2003 17:34:06 -0500
From: "Brett" <bbsouth@bellsouth.net>
Subject: What is expilcit package name?
Message-Id: <VGRAa.15511$iD2.14309@fe08.atl2.webusenet.com>

I'm getting this error:

syntax error at C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545, near "my "
Global symbol "$cookie2" requires explicit package name at
C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545. Execution of
C:\Inetpub\mb\ubbcgi\ultimatebb.cgi aborted due to compilation errors.

What does it mean?

Thanks,
Brett





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

Date: Wed, 28 May 2003 01:03:09 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: What is expilcit package name?
Message-Id: <bb0rg8$4m483$1@ID-184292.news.dfncis.de>

Brett wrote:
> I'm getting this error:
> 
> syntax error at C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545, near
> "my " Global symbol "$cookie2" requires explicit package name at 
> C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545. Execution of 
> C:\Inetpub\mb\ubbcgi\ultimatebb.cgi aborted due to compilation
> errors.
> 
> What does it mean?

It means that you are using the variable $cookie2 the first time at
line 545, without having declared it using 'my' or 'our'. The
suggestion, i.e. explicitly stating the package name, would work as well:

     $main::cookie2

or

     $::cookie2  # short for package main

/ Gunnar

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Wed, 28 May 2003 00:11:53 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Re: What is expilcit package name?
Message-Id: <3ED3FEC9.CCD20836@boeing.com>

Brett wrote:
> 
> I'm getting this error:
> 
> syntax error at C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545, near "my "
> Global symbol "$cookie2" requires explicit package name at
> C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545. Execution of
> C:\Inetpub\mb\ubbcgi\ultimatebb.cgi aborted due to compilation errors.
> 
> What does it mean?

	The "requires explicit package name" means that Perl can't
	tell where that symbol is defined.

	Since the error message says it's near a "my", there's likely
	just something odd about your syntax on that line. Or perhaps
	you're missing the semicolon on the prior line?

	Show us that exact line and the prior line, then folks can
	help you out easier.

		Mike


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

Date: Wed, 28 May 2003 00:39:51 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: What is expilcit package name?
Message-Id: <3ed404f5.163656684@news.erols.com>

"Brett" <bbsouth@bellsouth.net> wrote:

: I'm getting this error:
: 
: syntax error at C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545, near "my "
: Global symbol "$cookie2" requires explicit package name at
: C:\Inetpub\mb\ubbcgi\ultimatebb.cgi line 545. Execution of
: C:\Inetpub\mb\ubbcgi\ultimatebb.cgi aborted due to compilation errors.
: 
: What does it mean?

The "global symbol" bit is a red herring.  Fix the syntax error, and
the others will most likely go away.

Betcha line 544 lost its trailing semicolon.



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 5049
***************************************


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