[12369] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5969 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 12 04:07:29 1999

Date: Sat, 12 Jun 99 01:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 12 Jun 1999     Volume: 8 Number: 5969

Today's topics:
    Re: "use IO::Socket" hangs (Greg Andrews)
    Re: A Newbie needs HELP! <istarks@email.msn.com>
    Re: Accessing characters in a string? (SMS/Christian Fowler)
    Re: Accessing characters in a string? (Abigail)
    Re: Accessing characters in a string? (Larry Rosler)
    Re: Afraid to ask about Y2K! finsol@ts.co.nz
    Re: Disokaying files in a Browser (Tad McClellan)
    Re: Disokaying files in a Browser (Abigail)
    Re: Email/Comments Form <Webdesigner@NewWebSite.com>
    Re: File Locking <xpalo03@vse.cz>
    Re: Form Redirection (David Efflandt)
    Re: function to retrieve number of members in list flounder99@my-deja.com
    Re: good newbie advice (was Re: Silly old me) (Abigail)
    Re: good newbie advice (was Re: Silly old me) <uri@sysarch.com>
        HELP: Perl on Windows Platform??? <seongbae@students.uiuc.edu>
    Re: HELP: Perl on Windows Platform??? <rootbeer@redcat.com>
    Re: holding shell output in perl (Hasanuddin Tamir)
    Re: I'm really peaved off! (Abigail)
    Re: if (my $a=1) { } print $a; Why do i get undef an no (Larry Rosler)
    Re: if (my $a=1) { } print $a; Why do i get undef an no <uri@sysarch.com>
    Re: if (my $a=1) { } print $a; Why do i get undef an no (Abigail)
    Re: if (my $a=1) { } print $a; Why do i get undef an no (Abigail)
    Re: if (my $a=1) { } print $a; Why do i get undef an no (Larry Rosler)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 11 Jun 1999 21:29:05 -0700
From: gerg@shell.ncal.verio.com (Greg Andrews)
Subject: Re: "use IO::Socket" hangs
Message-Id: <7jsnmh$3a2$1@shell1.ncal.verio.com>

lauren@vortex.com (Lauren Weinstein) writes:
>Greetings.  A newly compiled 5.005_03 perl, which passed installation
>tests, exhibits the behavior that any program that includes:
>
>  use IO::Socket
>
>immediately hangs at that point.  Any clues appreciated!
>Thanks much.
>

Is your script missing the semicolon like your example?

Do you have -w on the #!/path-to-perl line?

Have you really tried the trivial case of writing a
program that has just three lines:

  #!/path-to-perl -w
  use IO::Socket;
  print STDOUT "Got past IO Socket\n";


  -Greg


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

Date: Fri, 11 Jun 1999 22:58:18 -0400
From: "Tony Stone" <istarks@email.msn.com>
Subject: Re: A Newbie needs HELP!
Message-Id: <O9GhABIt#GA.309@cpmsnbbsa03>

Hi, im a newbie too!  The first thing you should do is get a paid web
hosting service which has Perl installed.  I noticed your using a free AOL
Members page and as far as i know they do not give you access to a CGI
Directory.  You should check out www.cgi-resources.com and see some of there
tutorials and try to get a feel of how Perl works and what it does.... then
you will have a understadning of what could do the job.  I didnt even look
at the page but i can say that it would be pretty easy to do what you are
explaining... and ionfact there are aleady programs out there that do just
what you want.  Again, lcheck out www.cgi-resources.com to see some of these
programs.  Im learning to so i cant give you the best answers but good luck!
Tony Stone
tony@devnetwork.com
http://www.devnetwork.com

JJ wrote in message <7j665r$1dva$1@newssvr01-int.news.prodigy.com>...
>----- Original Message -----
>From: John Porter <jdporter@min.net>
>Newsgroups: alt.perl,comp.lang.perl.misc
>Sent: Wednesday, June 02, 1999 12:28 PM
>Subject: Re: A Newbie needs HELP!
>
>> Do you have all that data in a database, or some kind of data file,
>> other than the html files themselves?  How were these html files
>> generated in the first place?
>
>I'm afraid that the files were generated in HTML format only.  They are all
>basically a collection of links in exactly the same format as the example I
>uploaded to the web.  If I could somehow convert the information into a
>database format, I'm sure that would be the best answer, since this will be
>an ongoing project whereby links will be added and deleted over time.
>
>Since I am a *complete* novice at programming (




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

Date: 12 Jun 1999 03:47:29 GMT
From: sms@links.magenta.com (SMS/Christian Fowler)
Subject: Re: Accessing characters in a string?
Message-Id: <7jsl8h$p25$1@links.magenta.com>

Alan Petersen (alan@ultra.finchcomputer.com) wrote:
: sms@links.magenta.com (SMS/Christian Fowler) writes:
: 
: > I am trying to parse through a scalar with a string in it. How does I
: > access the n'th character? I am looking for the perl equivalent of
: > 
: > char c = myString[n];
: > 
:
: substr EXPR,OFFSET,LEN
: 
: For example:
: 
:   $c = substr $myString,$n,1;
: 

Thanks! I did find this but figured for sure there had to be a better way
if you only wanted just one character! oh well.

Thanks again.

-- 
  =-=
=-=%=-=  Christian Fowler | cfowler@magenta.com
  =-=


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

Date: 12 Jun 1999 01:12:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Accessing characters in a string?
Message-Id: <slrn7m3v3o.3uj.abigail@alexandra.delanet.com>

SMS/Christian Fowler (sms@links.magenta.com) wrote on MMCX September
MCMXCIII in <URL:news:7jrptg$328$1@links.magenta.com>:
;; I am trying to parse through a scalar with a string in it. How does I
;; access the n'th character? I am looking for the perl equivalent of
;; 
;; char c = myString[n];

Are you sure you want to go through the string character by character?
Perl has many ways to parse strings, going through it char by char is
usually a waste of time.

;; Sorry if this is obivious, my nutsheell book didn't seem to have an
;; answer.


I'd be surprised if the book doesn't. But what did the manual say?


Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


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


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

Date: Fri, 11 Jun 1999 22:19:05 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Accessing characters in a string?
Message-Id: <MPG.11cb8d9a2852d9bf989bce@nntp.hpl.hp.com>

In article <7jsl8h$p25$1@links.magenta.com> on 12 Jun 1999 03:47:29 GMT, 
SMS/Christian Fowler <sms@links.magenta.com> says...
> Alan Petersen (alan@ultra.finchcomputer.com) wrote:
> : sms@links.magenta.com (SMS/Christian Fowler) writes:
> : > I am trying to parse through a scalar with a string in it. How does I
> : > access the n'th character? I am looking for the perl equivalent of
> : > 
> : > char c = myString[n];
> :
> : substr EXPR,OFFSET,LEN
> : 
> : For example:
> : 
> :   $c = substr $myString,$n,1;
> 
> Thanks! I did find this but figured for sure there had to be a better way
> if you only wanted just one character! oh well.

That happens to be the most efficient way of doing it.

In C, chars and strings are different data types.  A string is a null-
terminated array of chars.  And chars and ints are assignment-compatible 
data types.

In Perl, a character is just a string of length 1 (hence the above 
'substr' statement).  And characters and integers require conversions to 
and from.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 12 Jun 1999 04:58:01 GMT
From: finsol@ts.co.nz
Subject: Re: Afraid to ask about Y2K!
Message-Id: <7jspcn$2c4$1@nnrp1.deja.com>

In article <7jpkbm$sc5$1@news.iex.net>,
  sbean@iex.net (Steve Bean) wrote:
> In article <375b7df9@newsread3.dircon.co.uk>, gellyfish@gellyfish.com
> says...
> >
> >Steve Bean <sbean@iex.net> wrote:
> >> But i WILL anyway.  I can't believe someof the flameout answers to
good
> >> questions about Y2K in this section.
> >>
> >
> >I cant believe that we have got to this stage in the game and
> >people are still asking this question - what precisely is it that
> >prevents from going to <http://www.deja.com> and searching for 'Y2K'
> >in this group ? It found 6500 hits just now.
> >
> >/J\
> >--
> >Jonathan Stowe <jns@gellyfish.com>
> >
> This is exactly what I am talking about.  What the hell is deja.com?
And
> who are you to flame out at anybody.  It 's obvious that you are not
> responsible for Y2K.  I dismiss you and do not worry about you.
>
> Steve Bean <sbean@iex.net>
>
>
Steve

I frequently see examples of programmers not understanding that Y2K
affects them and that they need to take action. Therefore, I have been
poking the hornets nest on Y2K for sometime now on these newsgroups and
the response is mostly always the same - go away you idiot, you know
nothing, we don't have a problem here and we are not interested in
discussing it.

Because I think its important to get the Y2K message out I have
persevered although I have endured a lot stupid, illogical, arrogant,
patronising and abusive responses.

I can only hope that this behaviour is more representative of the
average newsgroup contributor and not of programmers in general
otherwise what hope have we got that programmers can mitigate the worst
of the Y2K problems.

Why don't the Perl faction act more responsibly and offer suggestions as
to how Y2K audits are best done on Perl applications, the types of
problems found, the types of environments more likely to exhibit
problems, the percentage of problems found to lines of code checked, how
many problems were found through application testing as opposed to code
checking?, how many problems were found in supposedly remediated code?,
how were these problems found? etc. etc.

And, why don't some of the Perl coders come clean about when it was they
discovered the booby-trap code problem? I know why. No-one likes to
admit that they make mistakes, in particular egotistical computer
programmers. That is why you hear programmers squeal "We had to do it
that way!' whenever Y2K is mentioned.  That must be the biggest lie
ever! They seem to have the world believing them though.

The comment about 'deja.com' is an example of how narrow some
programmers' views of the computing world really is - they cannot
comprehend that the world of computers is vast and we can only hope to
know a small part of it. Thus the adage "The more you learn the more you
realise you don't know". Some of these Perl coders have a lot to learn -
perhaps the hard way. Most of them only know one computer language and
only one computing environment - and they think they know it all!

They also are ignorant of how the programs they write fit into the
organisation as a whole and just how dependant those organisations maybe
on a computer application. They rarely are able to grasp the wider
picture and can see it only in terms of their code, their application
and their computer.  IT departments are frequently cut-off from the rest
of the organisation and have very little loyalty to it as IT personnel
have very little understanding of the business issues. So, programmers
are apt to down-play the impact of Y2K as they see it as a technical
problem - they may have no idea of the impact to an organisation should
their application be unable to function for a day, a week or a month.

For those who are interested in Y2K problems that can occur in Perl &
other programming languages, check out:

http://www.y2kinfo.com/journal/features/0499_amona.html

http://www.y2kinfo.com/journal/features/0599_amon.html

Steve, you are right in being wary of asking questions about Perl and
Y2K. You have to put up with a lot of abuse if you question any of these
arrogant programmers or cast any doubt on their beloved programming
language. Perl coders seem to be the worst but C programmers aren't much
better.

Jocelyn Amon
--
Financial Solutions Limited
http://www.ts.co.nz/~finsol/


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 11 Jun 1999 15:42:51 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Disokaying files in a Browser
Message-Id: <rrorj7.9g8.ln@magna.metronet.com>

Reggy van Meurs (Reggy@Cistron.nl) wrote:

: I want to display a log file, with a browser.

: The log file is on a location at the http server.

: How can i do that ??


   perldoc -f open

   perldoc -f print

   perldoc -f close


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


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

Date: 12 Jun 1999 00:58:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Disokaying files in a Browser
Message-Id: <slrn7m3u9h.3uj.abigail@alexandra.delanet.com>

Reggy van Meurs (Reggy@Cistron.nl) wrote on MMCX September MCMXCIII in
<URL:news:7js1m7$n3q$1@enterprise.cistron.nl>:
__ Hello pls help.
__ 
__ I want to display a log file, with a browser.
__ 
__ The log file is on a location at the http server.
__ 


The same way as you display a jpg image.


This is not a Perl question. Please find a more appropriate newsgroup.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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


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

Date: Sat, 12 Jun 1999 01:15:36 GMT
From: Floyd Morrissette <Webdesigner@NewWebSite.com>
Subject: Re: Email/Comments Form
Message-Id: <7jscbi$uol$1@nnrp1.deja.com>

Don't use the hidden recipient element in the html. Instead your drop
down list should be named select. I believe this will work. Try it and
let me know.



In article <7js51c$sga$1@nnrp1.deja.com>,
  sherip@sonic.net wrote:
> I am attempting to create a comments form where readers may select
> (from a drop-down list) which section of the company their comment
> should be delivered to.
>
> There are about 10 different sections (each with their own email
> address) to choose from, but the form / email is to be delivered to
> only one (the one selected by the reader).
>
> I'm pretty new to this and use formmail.cgi from MSA.
>
> Your help is very much appreciated!
>
> Sheri
> sherip@sonic.net
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

--
Get your web site from http://www.NewWebSite.com
Consultation is always free.
Help with cgi scripts.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Sat, 12 Jun 1999 09:35:56 +0200
From: Ondrej Palkovsky <xpalo03@vse.cz>
Subject: Re: File Locking
Message-Id: <37620DDC.3EDE0EF6@vse.cz>

Craig Ciquera wrote:
> 
> You can only grab a lock, there is no way to test the lock.
> 
> Craig

> > if(flock(FILEHANDLE,2)){
> >     Do Stuff
> > }
> >
> > Neither work correctly, I thought that flock() returned true or false.
> > Either way stuff is getting done without taking turns.
You may try the NON-blockicg code, it means - if the FH is locked,
return immediatly. 

if (flock(FILEHANDLE,2+4)) {
   # File is locked - do stuff
}
# I locked the file 
# do stuff

#unlock the file
flock(FILEHANDLE,8);

Bye
  Ondrej Palkovsky
-- 
Somehow I reached excess without ever noticing when I was passing
through
satisfaction.
		-- Ashleigh Brilliant


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

Date: 12 Jun 1999 02:20:01 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Form Redirection
Message-Id: <slrn7m3gjv.i0.efflandt@efflandt.xnet.com>

On Fri, 11 Jun 1999 11:46:05 -0700, David <davidf@gaylordusa.com> wrote:
>
>Hash: SHA1
>
>I'm designing a web page that has a list of contact info 
>for a variety of service agents for my company.  I'm using 
>a form that submits to a perl script called selection.pl.  The 
>form works great while using Netscape but if I try it in 
>Internet Explorer it doesn't work at all.  I'm not sure why, but 
>I'm assuming it must be one of those browser specific html 
>codes.  
>
>The link to the site is http://www.gaylordusa.com/service-agents.html
>and the perl script contents are as follows:
(snip)
>My company (and myself) wants the web page to be viewed by all 
>browsers correctly and thus I need to fix this problem so it will work
>with both of them.  If you have any suggestions please send them 
>my way.  Respond directly to email if at all possible.  Thank You.

Perhaps some browsers don't recognize a form unless it ends with a </FORM>
tag and I could not find one anywhere near where your form ends after the
select list.

>P.S.  I use Textpad (a pseudo vi for windows) to edit my web pages, 
>so please give examples or hints in plain html or perl.
>
>
>
>Version: PGP for Personal Privacy 5.0
>Charset: noconv
>
>iQA/AwUBN2FYUkTNaOpKOuebEQJzxACeO9gygZ0jya4uWUmMDrvQEbc32YYAn3TD
>n5BgydrpaK+hXTpTkCemQBJX
>=hqZb
>-----END PGP SIGNATURE-----


-- 
David Efflandt    efflandt@xnet.com
http://www.xnet.com/~efflandt/


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

Date: Sat, 12 Jun 1999 02:18:45 GMT
From: flounder99@my-deja.com
Subject: Re: function to retrieve number of members in list
Message-Id: <7jsg1v$vrl$1@nnrp1.deja.com>

In article <3761b560.27217947@news.flash.net>,
  dalehend@flash.net wrote:
>
>
> Is there a function to return the number of members in a list or
> array?
>  Is it @{...} ?
>
>

using an array in a scalar context returns the number
of members in the array

@array = (1,2,3);

print scalar @array;
#prints 3


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 11 Jun 1999 19:34:05 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: good newbie advice (was Re: Silly old me)
Message-Id: <slrn7m3b8g.37n.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCX September MCMXCIII in
<URL:news:x71zfik8bu.fsf_-_@home.sysarch.com>:
<> 
<> 	***HAVE LOTS OF SEX AND MAKE MONEY WITH PERL*** 

Capital letters? Who are you and what did you do to our Uri?



Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


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


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

Date: 12 Jun 1999 00:15:05 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: good newbie advice (was Re: Silly old me)
Message-Id: <x7ogimhx6e.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Uri Guttman (uri@sysarch.com) wrote on MMCX September MCMXCIII in
  A> <URL:news:x71zfik8bu.fsf_-_@home.sysarch.com>:
  A> <> 
  A> <> 	***HAVE LOTS OF SEX AND MAKE MONEY WITH PERL*** 

  A> Capital letters? Who are you and what did you do to our Uri?

i got your attention, didn't i? now, i can push my MLM system written in
perl.

looks like you jumped jobs judging from the domain.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sat, 12 Jun 1999 00:07:00 -0500
From: seong joon bae <seongbae@students.uiuc.edu>
Subject: HELP: Perl on Windows Platform???
Message-Id: <Pine.GSO.4.10.9906120005080.21560-100000@ux12.cso.uiuc.edu>

Hi everyone,
I know that in Unix, you have to put something like....
#!/usr/local/bin/perl in order to run CGI script.
But how about Windows 9x?
What do you put on the first line in order to run CGI script?

Thanks.

Seong



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

Date: Fri, 11 Jun 1999 23:41:12 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: HELP: Perl on Windows Platform???
Message-Id: <Pine.GSO.4.02A.9906112339230.6999-100000@user2.teleport.com>

On Sat, 12 Jun 1999, seong joon bae wrote:

> I know that in Unix, you have to put something like....
> #!/usr/local/bin/perl in order to run CGI script.
> But how about Windows 9x?
> What do you put on the first line in order to run CGI script?

See the FAQ. Cheers!

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



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

Date: 12 Jun 1999 18:32:08 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: holding shell output in perl
Message-Id: <slrn7m2tjg.40u.hasant@borg.intern.trabas.co.id>

On Fri, 11 Jun 1999 13:30:34 GMT, Steve . <syarbrou@nospam.enteract.com> wrote:
> Thanks.  That sounds like a good possible solution.  However that
> would require the user to wait till it was finished before showing the
> output.  I was hoping, if possible, to modify and output the data the
> system call is making as it happens.
> 
> Steve
> 
> 
> On 10 Jun 1999 22:22:17 -0000, Jonathan Stowe
> <gellyfish@gellyfish.com> wrote:
> 
> >On Thu, 10 Jun 1999 18:49:18 GMT Steve . wrote:
> >> I have a perl script that calls rdist to do a system copy.  RDIST
> >> outputs things as it goes along to the screen.  I want that output to
> >> be caught by the perl script before it hits the screen and modified
> >> per my instructions.  How do you catch the output being displayed by a
> >> system call?  Thanks.
> >> 
> >
> >You should look for:
> >
> >  `STRING`
> >
> >or
> >
> >  qx/STRING/
> >
> >in the perlop manpage.
> >
> >/J\
> 

Seems you need filehandle for this. See the open
entry in the perlfunc manpage (perldoc -f open)
and look for how to open a pipe to external
command. Then you can use `while' loop to parse
the output, and go race with the command.

   ## not-so-useful-example
   my @ps = qw(ps faxwh);
   open PS, "-|" or exec @ps or die "ps fails: $!";
   print "List of running PIDs\n";
   while (<PS>) {
      print "$1\n" if /^\s*(\d+)/;
   }

See also perlipc manpage.

HTH,

-- 
-hasan-
uhm, no more sig(h)



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

Date: 11 Jun 1999 19:15:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: I'm really peaved off!
Message-Id: <slrn7m3a5d.37n.abigail@alexandra.delanet.com>

Erik Johnson (ejohnso9@earthlink.net) wrote on MMCX September MCMXCIII in
<URL:news:37615108.5EC432C8@earthlink.net>:
** 
** 
** brian d foy wrote:
** 
** > In article <3761395d@news2.vip.uk.com>, "Tobin" <Tobin@breathemail.net> posted:
** >
** > > ---------------------
** > > Errors:
** > > [Fri Jun 11 09:23:57 1999] access to /data1/hypermart.net/tobin/data1.pl
** > > failed for 194.176.215.106, reason: file permissions deny server execution
** > > exec of /data1/hypermart.net/tobin/data1.pl failed, reason: Exec format
** > > error (errno = 8)
** > > [Fri Jun 11 09:24:24 1999] access to /data1/hypermart.net/tobin/data1.pl
** > > failed for 194.176.215.106, reason: Premature end of script headers
** > > --------------------
**
** [ Lines trimmed to less than moron lenghts ]
** 
** Permissions problems are either errno 2 (ENOENT - "No such file or directory"
** or errno 13 (EACCES - "Permission Denied"). This is errno 8 (ENOEXEC -
** - "Exec format error") I can't see what you're doing with exec, but that is w
** you need to focus. Perhaps try to run the code you are exec'ing directly and 
** sure it is free of errors?


It's most likely a bad shebang line.

But there's no need for this group to do guess work. Tobin should talk
to his system administrator.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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


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

Date: Fri, 11 Jun 1999 20:52:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: if (my $a=1) { } print $a; Why do i get undef an not "1" ??
Message-Id: <MPG.11cb79361fc9b841989bc9@nntp.hpl.hp.com>

In article <Pine.GSO.4.02A.9906111736050.6999-100000@user2.teleport.com> 
on Fri, 11 Jun 1999 17:36:40 -0700, Tom Phoenix <rootbeer@redcat.com> 
says...
> On Fri, 11 Jun 1999, Larry Rosler wrote:
> 
> > I don't understand why 'use strict;' allowed those two uses of
> > $main::a without a declaration, though.
> 
> sort(). Cheers!

For anyone who is scratching their heads about this cryptic answer, here 
is the relevant snip from the documentation of sort():

"In the interests of efficiency the normal calling code for subroutines 
is bypassed, with the following effects: the subroutine may not be a
recursive subroutine, and the two elements to be compared are passed
into the subroutine not via @_ but as the package global variables $a
and $b ..."

Moral:  When copying-and-pasting sample code, change $a (and $b, which 
is never used, for some reason) into something better -- i.e., something 
else.

Time for a long, stiff drink...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 12 Jun 1999 00:18:14 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: if (my $a=1) { } print $a; Why do i get undef an not "1" ??
Message-Id: <x7k8tahx15.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> In article <Pine.GSO.4.02A.9906111736050.6999-100000@user2.teleport.com> 
  LR> on Fri, 11 Jun 1999 17:36:40 -0700, Tom Phoenix <rootbeer@redcat.com> 
  LR> says...
  >> On Fri, 11 Jun 1999, Larry Rosler wrote:
  >> 
  >> > I don't understand why 'use strict;' allowed those two uses of
  >> > $main::a without a declaration, though.
  >> 
  >> sort(). Cheers!

  LR> "In the interests of efficiency the normal calling code for subroutines 
  LR> is bypassed, with the following effects: the subroutine may not be a
  LR> recursive subroutine, and the two elements to be compared are passed
  LR> into the subroutine not via @_ but as the package global variables $a
  LR> and $b ..."

being my coauthor on a sort paper, i am embarrassed that you didn't know
that $a and $b were not checked by strict.

:-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 12 Jun 1999 01:06:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: if (my $a=1) { } print $a; Why do i get undef an not "1" ??
Message-Id: <slrn7m3uog.3uj.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCX September MCMXCIII in
<URL:news:MPG.11cb369e74f1d0b989bc6@nntp.hpl.hp.com>:
@@ 
@@ I don't understand why 'use strict;' allowed those two uses of $main::a 
@@ without a declaration, though.  That seems like a botch.  This is all 
@@ rather muddled, I fear. 


That's because $a is special. Try the same with $larry.


Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


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


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

Date: 12 Jun 1999 01:08:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: if (my $a=1) { } print $a; Why do i get undef an not "1" ??
Message-Id: <slrn7m3ur0.3uj.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCX September MCMXCIII in
<URL:news:x7so7yidbs.fsf@home.sysarch.com>:
<> >>>>> "JV" == Janning Vygen <janning@vygen.de> writes:
<> 
<>   JV> i know this!
<>   JV> But it doesnt fit to the definition of the my() function in the camel
<>   JV> book!
<>   JV> and why does it behave different if i say
<> 
<>   JV> $a++ if (my $a=getValue());
<>   JV> print $a;
<> 
<>   JV> i thought that "if () {}" and <statement> if (); are equivalent.
<> 
<> they are equivilent logically but not with regard to scope. the latter
<> modifies a simple statement and so no scoping is changed and changes to
<> $a are seen in the statement and afterwards. the former create a new
<> block and the my $a is scoped to that block including the conditional.
<> so any changes to $a are not see after the block closes.


The confusing part is that the expression following the 'if' is part
of the block; even when it's outside the {}.



Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


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


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

Date: Fri, 11 Jun 1999 22:08:02 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: if (my $a=1) { } print $a; Why do i get undef an not "1" ??
Message-Id: <MPG.11cb8b02b4e0f37c989bcd@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <x7k8tahx15.fsf@home.sysarch.com> on 12 Jun 1999 00:18:14 -
0400, Uri Guttman <uri@sysarch.com> says...
 ...
>   >> On Fri, 11 Jun 1999, Larry Rosler wrote:
>   >> 
>   >> > I don't understand why 'use strict;' allowed those two uses of
>   >> > $main::a without a declaration, though.
>   >> 
>   >> sort(). Cheers!
 ...
> being my coauthor on a sort paper, i am embarrassed that you didn't know
> that $a and $b were not checked by strict.
> 
> :-)

Of course I 'know' that.  It's a question of context  -- not list vsr 
scalar, or numeric vs string, but *mental* -- sort vs the rest of Perl.

The very special package globals $a and $b work OK in principle, but 
their very ordinary names pollute the namespace -- and the mindspace.  
In 20/20 historical hindsight, something more exotic (such as $^Y and 
$^Z) might have been better choices.

:-(

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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