[15709] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3122 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 22 14:05:55 2000

Date: Mon, 22 May 2000 11:05:24 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959018723-v9-i3122@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 22 May 2000     Volume: 9 Number: 3122

Today's topics:
    Re: "Breakthrough" Perl compiler? <rootbeer@redcat.com>
    Re: "Breakthrough" Perl compiler? <rootbeer@redcat.com>
    Re: "Breakthrough" Perl compiler? <glauber.ribeiroNOglSPAM@experian.com.invalid>
    Re: [ CGI ] Can you know how long someone stayed connec <rootbeer@redcat.com>
    Re: about sending HTML email from perl (Gwyn Judd)
        Any Perl Programmers For Hire? <ncharette@earthlink.net>
    Re: ARGGH!HELP! Can't parse these characters ÿ þ (Answe <kenhare@ultrapresence.com>
        Basic scripting question <adams@mrclin1.med.yale.edu>
    Re: Basic scripting question <billy@arnis-bsl.com>
    Re: Basic scripting question nobull@mail.com
    Re: Basic scripting question <godzilla@stomp.stomp.tokyo>
    Re: Can't retrieve from a hash after I restarted Apache <rootbeer@redcat.com>
    Re: ctime.pl problem <samay1NOsaSPAM@hotmail.com.invalid>
    Re: file locking (Bart Lateur)
    Re: file locking <dan@tuatha.sidhe.org>
    Re: file locking (Jerome O'Neil)
    Re: file locking <godzilla@stomp.stomp.tokyo>
    Re: file locking (Randal L. Schwartz)
    Re: file locking <godzilla@stomp.stomp.tokyo>
    Re: file locking <dan@tuatha.sidhe.org>
    Re: file locking (Jerome O'Neil)
    Re: Forum for 'how to do it' questions? <dmeyers@panix.com>
    Re: HELP MEEEEEE <blah@nospam.com>
    Re: HELP MEEEEEE <gellyfish@gellyfish.com>
    Re: HELP MEEEEEE <jeff@vpservices.com>
    Re: HELP MEEEEEE <blah@nospam.com>
    Re: HELP MEEEEEE <adolftw@tcts1.seed.net.tw>
    Re: HELP MEEEEEE (Bart Lateur)
    Re: HELP MEEEEEE <sue@pennine.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 22 May 2000 09:58:13 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: "Breakthrough" Perl compiler?
Message-Id: <Pine.GSO.4.10.10005220957010.23375-100000@user2.teleport.com>

On Fri, 19 May 2000, Gwyn Judd wrote:

> This isn't a compiler-to-machine-code anyway. From the description it
> appears to be some sort of obfuscator with the interesting property of
> also (apparently) speeding up your code.

Of course, if there's a simple way of really speeding up perl (in
general), it would have been incorporated into perl long ago.

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 May 2000 09:59:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: "Breakthrough" Perl compiler?
Message-Id: <Pine.GSO.4.10.10005220958270.23375-100000@user2.teleport.com>

On Fri, 19 May 2000, Bart Lateur wrote:

> With the new Activestate Perl 5.6 REQUIRING that Internet Explorer is
> installed, I pretty much doubt it.

I disagree. Even if this one implementation does require that, there are
plenty of other implementations that don't. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 May 2000 10:07:03 -0700
From: glauber <glauber.ribeiroNOglSPAM@experian.com.invalid>
Subject: Re: "Breakthrough" Perl compiler?
Message-Id: <057b7df8.d0d09780@usw-ex0104-026.remarq.com>

In article <f4igisob8qpj45fq113rft0m79qk0cc6v1@4ax.com>, Anthony
Argyriou <anthony@alphageo.com> wrote:
>bart.lateur@skynet.be (Bart Lateur) wrote:
>
>>I'm not making this up. I quote their website:
>>
>>http://www.activestate.com/ActivePerl/docs/faq/Windows/Install.
html



Hmm, it's true. Someone at Activestate should fix that file. The
one that comes with Perl is more explicit:

Windows 95/98:
[...]
ActiveX scripting host such as IE 4.0+, or Windows Scripting
Host
[...]

And i do believe that it's "required" only if you want to use
Perl as a Windows scripting language. In any case, Windows
Scripting Host is also free for download, and it opens your
system to a whole host of possibilities, such as the "ILOVEYOU"
virus! (only half :-)).


glauber

* 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: Mon, 22 May 2000 10:38:15 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: [ CGI ] Can you know how long someone stayed connected?
Message-Id: <Pine.GSO.4.10.10005221036320.23375-100000@user2.teleport.com>

On Fri, 19 May 2000, Gregory Heinrich wrote:

> Tom Phoenix wrote:
> 
> > On Thu, 18 May 2000, Charles Henry wrote:
> >
> > > I really hoped such a module existed since my browser apparently knows
> > > when I am connected and when I am not. Indeed it never prompts me to
> > > relogin once I have successfully authenticated, until I close the
> > > browser ... But I guess this is done internally by the browser ...
> >
> > Almost certainly, your browser is re-authenticating you with a remembered
> > username/password combination, and hiding that fact from you. 

> Well I think this is because the website tells your browser to store a
> session cookie (a cookie that stays on your disk until the browser is
> shut down).

No, this behavior is observed on many (all?) browsers, even ones which
don't support cookies, or when cookies are disabled.

> > Of course,
> > this would be better discussed in a forum about browsers, servers,
> > authentication, and maybe even CGI programming. Cheers!

Still good advice. :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 May 2000 15:10:03 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: about sending HTML email from perl
Message-Id: <slrn8il7ug.5tv.tjla@thislove.dyndns.org>

I was shocked! How could Nice <abc@def.com>
say such a terrible thing:
>hi all,
>I am newbie to UNIX, I tried to write a Perl program for email sending, the
>mailing program I am using is sendmail, my question is how can I send a HTML
>format email by sendmail?? what is the param or instruction, thx

well I'm guessing you will have to format the HTML yourself unless there
is some module that will format text or whatever into HTML for you (I
know of none (disclaimer: I Am Not A Guru (tm))). As for sending it
though you can use MIME::Lite to format multipart emails which I guess
should work.

-- 
Gwyn "IANAG" Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
"sic transit discus mundi"
(From the System Administrator's Guide, by Lars Wirzenius)


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

Date: Mon, 22 May 2000 17:41:18 GMT
From: "Norm" <ncharette@earthlink.net>
Subject: Any Perl Programmers For Hire?
Message-Id: <2jeW4.14900$S31.396796@newsread2.prod.itd.earthlink.net>

I am overloaded with custom Perl programming orders.

Anyone for hire to take on some modular Perl piece work for Unix?

Must be fairly available by email or telephone during daytime and be able to
work in coding subroutines as part of a larger package. Included library
files will be supplied. Work involve mainly CGI scripting & flat database
file creation Input/Output. Must be willing to work at a reasonable hourly
rate or work fast :-)

If interested please reply to ncharette@earthlink.net

Please include the following:

Your name:

When available - Day Time/ Night Time/ Both:

When can you start:

Years of experience programming Perl:

Prefer method of payment - per bid/ per hour:

Your desired hourly fee:


Thank you,

Normand Charette
ncharette@earthlink.net




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

Date: Mon, 22 May 2000 10:57:35 -0600
From: Ken Hare <kenhare@ultrapresence.com>
Subject: Re: ARGGH!HELP! Can't parse these characters ÿ þ (Answered!!)
Message-Id: <220520001057351721%kenhare@ultrapresence.com>

Hi All,

Thanks to Larry and John for the input. I ended up using hex values for
the characters and that worked fine. The following is what I came up
with.

<snip>
if ($name eq 'GridData') {
         $Cx="::";
         $Rx="|";
         $value =~ s/Qty/Q/;
         $value =~ s/SKU/C/;
         $value =~ s/Name/D/;
         $value =~ s/NoTax/F/;
         $value =~ s/Price/P/;
         $value =~ s/\xff/$Rx/g;
         $value =~ s/\xfe/$Cx/g;
       
         
         @prods=split(/\|/,$value);
    
         $value="";
          foreach $morsel(@prods) {
          ($Q, $C, $D, $F,$P) = split(/$Cx/,$morsel);
              
              if ($F == 1 && ($F ne 'F')){
               $F="{GST}";
               }
               elsif ($F ne 'F')
               {$F="";
               }
               $value=$value.$P.$Cx.$Q.$Cx.$C.$Cx.$D.$Cx.$F.$Rx;
         }
         chop $value;
         $name = 'Products';
         $Products = $name;
         $Products_Value= $value;
         };
<snip>

This is step one. Now on to the next step of trying to get this to
another script on a secure server without the client noticing. :-)

I'm fairly new to Perl so I appreciate any help.

Ken Hare

P.S. sorry about the bad User info in the original post.


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

Date: Mon, 22 May 2000 12:58:29 -0400
From: e adams <adams@mrclin1.med.yale.edu>
Subject: Basic scripting question
Message-Id: <39296735.A567BB8E@mrclin1.med.yale.edu>

Hi,
I'm  new Perl user and would like to know if there is a way to write
script that, for example, deletes every 3rd line in a file. I am able to
substitute every 3rd line with a blank line but I can not delete the
line unless I go into an editor and do it manually.
Thank you for any advice
e adams



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

Date: Mon, 22 May 2000 19:32:18 +0300
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Basic scripting question
Message-Id: <39296112.56FB@arnis-bsl.com>

e adams wrote:
> 
> Hi,
> I'm  new Perl user and would like to know if there is a way to write
> script that, for example, deletes every 3rd line in a file. I am able to
> substitute every 3rd line with a blank line but I can not delete the
> line unless I go into an editor and do it manually.
> Thank you for any advice
> e adams

Sounds like a FAQ:

 "How do I change one line in a file/delete a line in a file/insert
  a line in the middle of a file/append to the beginning of a file?"

Consult your local perldoc perlfaq5 or 
http://www.cpan.org/doc/manual/html/pod/perlfaq5.html.

Ilja.


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

Date: 22 May 2000 18:29:35 +0100
From: nobull@mail.com
Subject: Re: Basic scripting question
Message-Id: <u91z2uqyrk.fsf@wcl-l.bham.ac.uk>

e adams <adams@mrclin1.med.yale.edu> writes:

> I'm  new Perl user...

 ...so you can reasonably guess that any questions you have are very
likely to be frequently asked (and not just because you've posted
this four times already).

> and would like to know if there is a way to write
> script that, for example, deletes every 3rd line in a file. I am able to
> substitute every 3rd line with a blank line but I can not delete the
> line unless I go into an editor and do it manually.

Yep, that's in the FAQ.  Please read the FAQ.

BTW: Please be less thoughless in your subject lines.  Remember that
subject lines are what appear when people do newsgroup searches.  Just
because you are too lazy to do things right you shouldn't actively
make life harder for people who are not.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 22 May 2000 11:03:20 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Basic scripting question
Message-Id: <39297668.AA693E00@stomp.stomp.tokyo>

e adams wrote:

> I'm  new Perl user and would like to know
> if there is a way to write script that, 
> for example, deletes every 3rd line in a file. 
> I am able to substitute every 3rd line with a 
> blank line but I can not delete the line unless 
> I go into an editor and do it manually.

> Thank you for any advice

One of many possible solutions would be
to open your file for read, use a counter
of sorts and then write your file on
the fly. 

No code this time as usual, I have a shovel,
a wheelbarrow and several tons of dirt and
rock beckoning to my lazy big butt.

open your file
slurp entire contents for safety
(a backup copy first would be wise)
foreach loop your file lines..

Here is a trick, write an algorithm which
produces a quotient number based on your 
actual line number divided by three...

make an array 1,2,3,4,5.. sequentially 
inclusive, for quotient comparison

line number divided by three yields a quotient

if your quotient does _not_ match an element in
your quotient number set array, print your line 
to your file

This would catch all multiples of three or,
another way, disregard every third line.

Don't forget your first element is zero
by default if you choose to use element
numbers within an algorithm.

Heh! Might be easier but less fun to
create a simple line counter which 
resets to one each time it hits three.

if my line counter equals one or two,
print my stuff!

 ;)

Hang around, lots of people will post
example code for you.

Godzilla!


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

Date: Mon, 22 May 2000 10:53:59 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Can't retrieve from a hash after I restarted Apache
Message-Id: <Pine.GSO.4.10.10005221049220.23375-100000@user2.teleport.com>

On Sat, 20 May 2000, Vincent wrote:

> Subject: Can't retrieve from a hash after I restarted Apache

You seem to have posted this twice. Don't do that. :-)

> I have two scripts. *The first one : 'startup.pl' is called when I
> restart Apache. In this script I put every html pages in a hash. At
> this moment, I can retrieve the files, everything is ok. When I call
> the script manually my hash is full, but when I restart Apache my hash
> is empty

I think that's to be expected. But perhaps you want to search for the
docs, FAQs, and newsgroups about Apache to learn more. 

> sub load_file
> { 
> my($fn) = @_; 
> local(*IN); 
> my($file); 
> if (open(IN, $fn)) { 
> read(IN, $file, -s IN); 
> close(IN); 
> } 

You should probably indent your code properly. Even though perl doesn't
care what indentation you use, using good indentation will make your code
easier to read, write, debug, and maintain. Certainly you can't expect
most folks around here to be helpful when you're not doing your part to
make your code easier to read. :-)

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 May 2000 07:51:12 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: ctime.pl problem
Message-Id: <0024d1d0.722642aa@usw-ex0104-087.remarq.com>

My ctime.pl says..

;# ctime.pl is a simple Perl emulation for the well known ctime
(3C) function.
;#
;# Waldemar Kebsch, Federal Republic of Germany, November 1988
;# kebsch.pad@nixpbe.UUCP
;# Modified March 1990, Feb 1991 to properly handle timezones
;#  $RCSfile: ctime.pl,v $$Revision: 4.1 $$Date: 92/08/07
18:23:47 $
;#   Marion Hakanson (hakanson@cse.ogi.edu)
;#   Oregon Graduate Institute of Science and Technology
;#
;# usage:
;#
;#     #include <ctime.pl>          # see the -P and -I option
in perl.man
;#     $Date = &ctime(time);




* 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: Mon, 22 May 2000 15:15:53 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: file locking
Message-Id: <392a4eda.580667@news.skynet.be>

Godzilla! wrote:

>Alexander Melchers wrote:
> 
>> By using Fcntl as follows:
> 
>> use Fcntl qw/:flock/;

>For trivia sake, the old fashion way of doing
>this is to declare "Literals" which are actually
>Globals under a different name:
>
>$LOCK_SH = 1;
>$LOCK_EX = 2;
>$LOCK_NB = 4;
>$LOCK_UN = 8;

Only if these happen to be the correct values for your platform. This is
NOT garanteed. There are known exceptions.

-- 
	Bart.


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

Date: Mon, 22 May 2000 15:54:46 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: file locking
Message-Id: <aLcW4.89636$hT2.379244@news1.rdc1.ct.home.com>

Michel Dalle <michel.dalle@usa.net> wrote:

> AFAIK, appending doesn't require locking, since its atomicity is
> handled by the underlying O.S.

No. Not on Unix, at least--no atomicity is guaranteed with files. If
you're on another OS then it might (VMS certainly does) but Unix doesn't.

					Dan


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

Date: Mon, 22 May 2000 16:03:21 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: file locking
Message-Id: <dTcW4.3649$QB4.297144@news.uswest.net>

Larry Rosler <lr@hpl.hp.com> elucidates:

> You should give back your dictionary or your degree, or both.  Is there 
> *no* field of endeavor in which you are competent?

Larry, it is a *master* troll.  Even if it did get it's PhD from a
matchbook cover.  


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

Date: Mon, 22 May 2000 09:21:39 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: file locking
Message-Id: <39295E93.BD5236F5@stomp.stomp.tokyo>

Bart Lateur wrote:
> Godzilla! wrote:
> >Alexander Melchers wrote:

> >> By using Fcntl as follows:

> >> use Fcntl qw/:flock/;
 
> >For trivia sake, the old fashion way of doing....
 
> Only if these happen to be the correct values for your platform. This is
> NOT garanteed. There are known exceptions.



"For trivia sake, the old fashion way...."
     ^^^^^^

"I believe these once popular grandmother methods 
 might be what led to names now used under Fcntl,
 to greater advantage as you have discussed."
                             ^^^^ ^^^^^^^^^


Ahem...


Godzilla!


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

Date: 22 May 2000 09:50:27 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: file locking
Message-Id: <m1d7me1qcs.fsf@halfdome.holdit.com>

>>>>> "Dan" == Dan Sugalski <dan@tuatha.sidhe.org> writes:

Dan> No. Not on Unix, at least--no atomicity is guaranteed with files.

Well, at the write(2) level, yes.  But if you are using print()
instead of syswrite(), you might possibly get a two-write write() if
you cross a STDIO boundary, and then your atomic write is blown to
bits.

Moral - always use syswrite() when you want an atomic write (but then
you gotta deal with a partial write... ugh :).

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Mon, 22 May 2000 10:23:02 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: file locking
Message-Id: <39296CF6.3383BA9C@stomp.stomp.tokyo>

Jerome O'Neil wrote:
 
> Larry Rosler <lr@hpl.hp.com> elucidates:
> 
> > You should give back your dictionary or your degree, 
> > or both.  Is there *no* field of endeavor in which 
> > you are competent?

> Larry, it is a *master* troll.  Even if it did get it's PhD from a
> matchbook cover.


USENET guidelines, paraphrased, indicate:

"Flaming for spelling, punctuation, grammar errors
 and similar, will earn you a Slime Badge."

"Use of personal level insults is a well practiced
 art of blithering idiots."


Nobody forces you or others to engage
in these types of sociopathic behaviors.
Yours is a personal freewill choice. You
have only yourself to fault.


Godzilla!


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

Date: Mon, 22 May 2000 17:23:39 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: file locking
Message-Id: <v2eW4.89858$hT2.379447@news1.rdc1.ct.home.com>

Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Dan" == Dan Sugalski <dan@tuatha.sidhe.org> writes:

> Dan> No. Not on Unix, at least--no atomicity is guaranteed with files.

> Well, at the write(2) level, yes.

True, but folks rarely use write(2) to write to files. And, of course,
there's no guarantee that a particular write(2) will actually write the
entire contents of the buffer in one go, though this is generally not a
problem with files.

> But if you are using print()
> instead of syswrite(), you might possibly get a two-write write() if
> you cross a STDIO boundary, and then your atomic write is blown to
> bits.

You can be bit hard by buffering with print in a number of ways, which is
always fun. Interleaved output, garbage, missing bits--way fun. :)

> Moral - always use syswrite() when you want an atomic write (but then
> you gotta deal with a partial write... ugh :).

Moral - never assume anything's atomic, and lock down everything you need
in a known state. (What, me, paranoid because of threads? Nah...)

					Dan


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

Date: Mon, 22 May 2000 17:32:27 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: file locking
Message-Id: <LaeW4.3685$QB4.302345@news.uswest.net>

"Godzilla!" <godzilla@stomp.stomp.tokyo> elucidates:
> Jerome O'Neil wrote:

>> Larry, it is a *master* troll.  Even if it did get it's PhD from a
>> matchbook cover.
> 
> USENET guidelines, paraphrased, indicate:

Blah blah blah...  

Call the usenet cops on me.

> "Flaming for spelling, punctuation, grammar errors
>  and similar, will earn you a Slime Badge."

Especialy after said poor grammarian spent two paragraphs 
braging on it's PhD in english.
 
> "Use of personal level insults is a well practiced
>  art of blithering idiots."

The practice of flaming idiots has been honed to a 
fine art, thanks to your endless supply of material.

> Nobody forces you or others to engage
> in these types of sociopathic behaviors.

I don't do it because I'm forced to, I do it 
because I *like* to.  You are a moron.  Whats worse
is that you're too dumb to realise it.

> Yours is a personal freewill choice. You
> have only yourself to fault.

Exactly.  As it is a freewill choice, I will continue to flame 
you when it pleases me to do so.  

And for that, you have only yourself to blame.



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

Date: 22 May 2000 11:19:56 -0400
From: David Meyers <dmeyers@panix.com>
Subject: Re: Forum for 'how to do it' questions?
Message-Id: <yob4s7qvcgz.fsf@panix2.panix.com>

jones <ra.jones@NO_UCE*cwcom.net> writes:

> >> > And in your own interest, _do_ desist from upside-down-quoting.
> >
> >> That seems to be a matter of opinion.
> >Perhaps, but the opinion of this newsgroup is as Alan said.  Look back
> >through the archives (at www.deja-news.com) under the keyword
> But as I went on to say - I have no problem with retaining the quote 
> above the reply. It certainly makes the reply easier to understand. We 
> have no dispute here.

And one more minor note of convenience for your readers, add a touch
of whitespace.

--d



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

Date: Mon, 22 May 2000 17:18:01 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: HELP MEEEEEE
Message-Id: <39294FA9.D523FE1C@nospam.com>

Adolf,

Adolf wrote:
> source code:
> print <<Hi
> yes
> Hi
> when type => c:\perl\bin\perl e:\www\hi.plx
> why show"Can't find string terminator "Hi" anywhere before EOF 
> at e:\www\hi.plx line 1"?

  Be careful with that (obsolete) idiom:

<code>
	print << 'Hi';
	yes
	Hi
</code>


	Best regards,
		Marco


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

Date: Mon, 22 May 2000 15:42:42 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HELP MEEEEEE
Message-Id: <SzcW4.582$6T1.91839@news.dircon.co.uk>

On Mon, 22 May 2000 17:18:01 +0200, Marco Natoni Wrote:
> Adolf,
> 
> Adolf wrote:
>> source code:
>> print <<Hi
>> yes
>> Hi
>> when type => c:\perl\bin\perl e:\www\hi.plx
>> why show"Can't find string terminator "Hi" anywhere before EOF 
>> at e:\www\hi.plx line 1"?
> 
>   Be careful with that (obsolete) idiom:
> 
> <code>
> 	print << 'Hi';
> 	yes
> 	Hi
> </code>
> 

Obsolete ? Care to explain that comment which seems to be at variance with
the perlstyle document for 5.6.0 :

       o   Use here documents instead of repeated print()
           statements.

/J\


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

Date: Mon, 22 May 2000 08:53:15 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: HELP MEEEEEE
Message-Id: <392957EB.1BC9C9C7@vpservices.com>

Adolf wrote:
> 
> source code:
> print <<Hi
> yes
> Hi
> 
> when type => c:\perl\bin\perl e:\www\hi.plx
> 
> why show"Can't find string terminator "Hi" anywhere before EOF at
> e:\www\hi.plx line 1"?


Oops, I just spotted the error: there is no semi-colon after the first
word "Hi".

Also, next time, please choose a subject line that reflects the topic of
your posting and don't put capitals or repeated characters in it.

-- 
Jeff


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

Date: Mon, 22 May 2000 17:54:26 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: HELP MEEEEEE
Message-Id: <39295832.6D7487FE@nospam.com>

Jonathan,

Jonathan Stowe wrote:
> Obsolete ? Care to explain that comment which seems to be at 
> variance with the perlstyle document for 5.6.0 :

  Your PERL itself should explain that

<cite>
        Use of bare << to mean <<"" is deprecated at ... line ....
</cite>

as the OP code showed in its first line.


	Best regards,
		Marco


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

Date: 22 May 2000 15:54:24 GMT
From: "Adolf" <adolftw@tcts1.seed.net.tw>
Subject: Re: HELP MEEEEEE
Message-Id: <8gbl7g$6j4$1@news.seed.net.tw>

Thank you.
I really forgot to type carriage return after the last "Hi".




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

Date: Mon, 22 May 2000 16:11:29 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: HELP MEEEEEE
Message-Id: <39335af5.3679096@news.skynet.be>

Jonathan Stowe wrote:

>>   Be careful with that (obsolete) idiom:
>> 
>> <code>
>> 	print << 'Hi';
>> 	yes
>> 	Hi
>> </code>
>> 
>
>Obsolete ? Care to explain that comment which seems to be at variance with
>the perlstyle document for 5.6.0

I think he's referring to the unquoted terminator string:

>	print <<Hi

BTW Either there, or at the start of the first line following the "Hi"
line, there should be a ";", or a "}" (if in a block) if any code is to
follow.

And the common reason why this fails is [A] because the "Hi" isn't the
only thing on that line, or [B] because it's the last line of the script
and there is no newline following it...

-- 
	Bart.


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

Date: 22 May 2000 08:29:59 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: HELP MEEEEEE
Message-Id: <8gbjpn$2apl@drn.newsguy.com>

In article <39294A97.E92ABFB8@vpservices.com>, Jeff says...
>
>Adolf wrote:
>> 
>> source code:
>> print <<Hi
>> yes
>> Hi
>> 
>> when type => c:\perl\bin\perl e:\www\hi.plx
>> 
>> why show"Can't find string terminator "Hi" anywhere before EOF at
>> e:\www\hi.plx line 1"?
>> 
>> HELP MEEEEEEEE
>
>
>Two questions:
>
>Is there a carriage return after the last "Hi"?
>
>Is there anything betweent the "i" of the last "Hi" and that carriage
>return?
>
>Play with those and your problem will go away.
>

Shouldn't it be

print <<Hi;
yes
Hi

The semicolon is missing.



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

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 3122
**************************************


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