[16095] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3507 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 29 06:10:29 2000

Date: Thu, 29 Jun 2000 03:10:19 -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: <962273419-v9-i3507@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 29 Jun 2000     Volume: 9 Number: 3507

Today's topics:
    Re: opening a filehandle-newbie (Tad McClellan)
        Perl+MySQL Profi fuer Projekt gesucht!! <rene@schweier.de>
    Re: pipes (David Efflandt)
        Please help me <gnappuNOgnSPAM@yahoo.com.invalid>
    Re: Reading files from PerlScript? (Malcolm Dew-Jones)
    Re: Redirect <o1technospam@skyenet.nospam.net>
    Re: regex - slurp file and extract email addresses <gellyfish@gellyfish.com>
    Re: regex - slurp file and extract email addresses (Abigail)
    Re: regex and hashes <gellyfish@gellyfish.com>
    Re: Scheduled script <chkwok@unitech-com.com>
    Re: sending SMS <gellyfish@gellyfish.com>
        Strange behaviour in upper case conversion (Philip Lees)
        Subject using Net::SMTP <mike@cyborg-group.com>
    Re: Subject using Net::SMTP <Peter.Dintelmann@dresdner-bank.com>
    Re: Teen Volenteers WANTED <cooljazz.nospam@flash.net>
    Re: Teen Volenteers WANTED (Bart Lateur)
        Unix Login on WNserver <J.J.Settels@amc.uva.nl>
    Re: Where do uninitialized values come from? (Tad McClellan)
    Re: Where do uninitialized values come from? <fbartlet@optonline.net>
        while-loop and regex question <hubert.ming@iggi.lu.ch>
        Why am I not picking up anything from a datafile? <kamri@asiapacificm01.nt.com>
    Re: Why am I not picking up anything from a datafile? <support@broadspeed.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 28 Jun 2000 23:47:24 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: opening a filehandle-newbie
Message-Id: <slrn8llhmc.2ja.tadmc@magna.metronet.com>

On Thu, 29 Jun 2000 02:46:02 GMT, quetzlcotl@my-deja.com <quetzlcotl@my-deja.com> wrote:


[ others have answered your real question, but I cannot let
  the below slide by without saying something about it.
]


>I am typing this exactly(read from "sams teach youself perl in 24hrs"-
>excellent book btw Mr Clinton Pierce:))obviously sunstituting the names
>below for valid filenames and my own filehandle name:
>
>open (FILEHANDLE, "filename");


You should always, yes *always*, check the return value from open():

   open(FILEHANDLE, 'filename') || die "could not open 'filename'  $!";


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


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

Date: Thu, 29 Jun 2000 07:24:25 GMT
From: R.Schweier <rene@schweier.de>
Subject: Perl+MySQL Profi fuer Projekt gesucht!!
Message-Id: <8jetj0$p13$1@nnrp1.deja.com>

Hallo,

für umfangreiche Projekte suchen wir einen Perl-Profi
oder Software-Schmiede zur externen Verstärkung.

Wer hat Lust in Perl+MySQL zu entwickeln. Die Projekte
sind umfangreich, und nur für jemand der schon einige
Zeit programmiert.

Die Abwicklung sollte gegen Rechnung erfolgen koennen.

Bitte kurz mailen, damit das weitere Vorgehen besprochen werden
kann.

Gruss

René Schweier


--
*******
Rene Schweier - Tel: 0173/3104770 - mail: rene@schweier.de
*******



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


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

Date: 29 Jun 2000 06:50:56 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: pipes
Message-Id: <slrn8llsdo.v1.efflandt@efflandt.xnet.com>

On Tue, 27 Jun 2000 22:32:15 -0700, Guy Speier <speier@aracnet.com> wrote:
>Hello,
>
>I am trying to open multiple pipes to an external application, so that I can
>write to each of them, close the pipe, and have them all run simultaneously.
>I would like to close these pipes and exit my script without waiting for
>them, but more importantly, I would like them to not run sequentially.

Have you read 'perldoc perlipc' (type that without quotes on any system
with Perl)?

>When I look in O'reilly & Associates, under close, I see "Note, however,
>that a dup'ed pipe is treated as an ordinary filehandle, and close will not
>wait for the child on that filehandle.
>
>How can I "dup" a pipe?  I would love an example / explanation mailed to
>mailto:speier.guy@cnf.com

Maybe a dup'd pipe is not what you think it is.  For example you can dup
STDERR to STDOUT so you can get both on the same filehandle.  But you
would not normally dup a bunch of filehandles into a single external
process.  You would either fork a process for each, or if that process
could fork off each request on its own, you would likely use something
like a socket (like a webserver) or fifo (named pipe that works similar to
a regular file).

>Thank you muchly in advanced!
>Guy

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Wed, 28 Jun 2000 21:01:29 -0700
From: susan++ <gnappuNOgnSPAM@yahoo.com.invalid>
Subject: Please help me
Message-Id: <24eb4ad2.d04c758f@usw-ex0107-055.remarq.com>

Hi,

Can anyone help me with my survey at www.akirapc.com/survey ?
I wrote some PERL and HTML to collect data for my school
project.  Now
I need people to aswer my questions (4). Could you please
help? :)

Thanks

Suz

ps it would be wonderful if you could pass my survey to other
people.


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: 28 Jun 2000 23:35:59 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Reading files from PerlScript?
Message-Id: <395aee4f@news.victoria.tc.ca>

Alex T. (samara_biz@hotmail.com) wrote:
: Hi,

: I'm trying to write a PerlScript, which would dynamically output an HTML
: page from a file, depending on the results passed to it from the Query
: string.

: For example:
: http://www.website.com/index.asp?login should display login.html
: http://www.website.com/index.asp?signup should display signup.html,
: etc...

: I can not use simple redirection, because I don't want those other files
: (login.html, signup.html... etc) to be accessible without calling them
: through index.asp and the PerlScript, meaning that those files are not
: gonna have read permissions... I only want my script to be able to read
: them.

: Does anyone know how to go about it? Can I use standard Perl open, read,
: close functions? Maybe something like the code below? (I tried it but it
: doesn't do anything)

: <%
:  open(SOURCE, "<login.html");
:  while(read(SOURCE, $data, 1024))
:  {
:       $Response->Write($data);
:   } #while
:  close(SOURCE);
: %>

: Thanks in advance!

: Alex


(I haven't tried this with Perl scripts)

(On unix) Make the (user or group) owner of the script someone able to
read the files, then SUID or GUID the script to that owner.

HOWEVER, NEVER SUID TO ROOT - or anything similar - instead you must set
up a one-of user or group to access the files and then assign that user or
group only to the file to be accessed and to the script/program that will
be used to read that file. 



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

Date: Thu, 29 Jun 2000 01:33:50 -0500
From: "Jim Kauzlarich" <o1technospam@skyenet.nospam.net>
Subject: Re: Redirect
Message-Id: <Q_B65.2138$MZ3.7892@newsfeed.slurp.net>

If you don't need to have your perl script create any HTML output, you can
use Location:

Here is an snippet of code that I have running on my website.  The perl
script returns $line with a randomly chosen value each time it's called.
Just remember to NOT include the print "Content-type:text/html\n\n";  .

print "Location: ../index2.html?wisdom=$line\n\n";

This is an example of the (entire) output it might generate:

Location:
 ../index2.html?wisdom=$%22640K+ought+to+be+enough+for+anybody.%22+-+Bill+Gat
es,+1981

Hope this helps!



"Gary Cohen" <cobroautomotive.msn@email.msn.com> wrote in message
news:OCCAOFF4$GA.281@cpmsnbbsa07...
> I am trying to use a Perl script for CGI Programming.
>
> The idea is that the user (using an HTML form) logs in on one page, and
then
> a perl script will validate the login and then redirect the user to either
a
> valid or invalid login page. I would rather use an ASP page to display
valid
> info but how do I get perl to redirect me to that ASP Page?
>
> I tried this:
>
>  print redirect(-location=>"http://location/index.asp" ,-nph=>1);
>
> But I get an error 302 saying Location has moved or something. I tried it
> with other internet pages and it didnt work still. What is up with this?
The
> Perl script works except for this.
>
> Gary
>
>




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

Date: 29 Jun 2000 10:11:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: regex - slurp file and extract email addresses
Message-Id: <8jf3si$uft$1@orpheus.gellyfish.com>

On 27 Jun 2000 12:34:36 EDT Chris Sorensen wrote:
> Tom Phoenix wrote:
>> 
>> On 26 Jun 2000, Chris Sorensen wrote:
>> 
>> > If I don't ask .. how will I lean the syntax of regular expressions ..
>> 
>> No one is saying that you're not allowed to ask. But what you're trying to
>> do can't be done with simple patterns.
>> 
>> > I haven't seen an email address that looks like this joe
>> > blow@something.net ... there's usually an _ between the joe and blow
>> 
>> How about this one:
>> 
>>     <"fred and barney"@redcat.com>
>> 
>> Okay, now you _have_ seen a valid e-mail address with a space in it. :-)
>> 
>> Now, if you still want to find out the format of e-mail addresses, you can
>> read RFC-822.
>> 
>> Cheers!
>> 
> I realize that the whitespace/something/@/something/whitespace
> expression isn't ideal .. but (and forgive me if I'm just too dense to
> get it) it seems like it would catch most email addresses .. and
> probably suffice for this specific task.
> 

OK. An '@' with no white space characters either side (assuming whole text
in $variable) :

  @stuff = $variable =~ /(\S+\@\S+)/g ;

Now running that on a file with lots of nice e-mail addresses in - my
mailbox  - gives me *more than 50% bad* 'addresses' :

_mysql@<a
href="mailto:_mysql@excite.com">excite</a>.com</span></p>
(@ARGV)
(@d{qw(summ
href=3D"news:8h7luo$sv1$1@orpheus.gellyfish.com">news:8h7luo$sv1$1@orpheu=
href=3D"mailto:ittso.3wing@videotron.ca">ittso.3wing@videotron.ca</A>&gt;=
<7115F7425C43D311A1BD0010E360FDBE2C9407@SXCKMC01CGCFGE>
M(R!097)L('-C<FEP="!T;R!H86YD;&4@=7-E<B!S96QE8W1I;VX@9G)O;2!H
M;W-T('!A9V5S(&EN8VQU9&EN9R!R969R97-H(')A=&4@9F]R(&=I9B!D:7-P

For instance.

This is not counting a lot of things that look like e-mail addresses like
Msg-Ids and things that were once part of valid email addresses but no
longer are because the naive regular expression has broken then up.

> I'm not arguing that there aren't better (more thorough) ways to search
> for email addresses, 

But people arent saying that what you are proposing is a worse way of
searching for e-mail addresses , they are saying that it isnt a way of
searching for *e-mail addresses* at all.  You might as well print every
line of the text with an '@' in it for all the hand cleaning you are
going to have to do with your data (and even that isnt foolproof as the
address might easily have a newline in it).

>                      but if I can't even write an expression this basic,
> HOW will I write a more complex expression. (whew .. that was a long
> sentence!)
> 

You can read about regular expressions in the perlre manpage.

> My goal is to learn how to write this simple expression .. then keep
> expanding on it until I have what I need. 

As has already been pointed out the expression in 'Mastering Regular
expressions' for identifying e-mail addresses in free text stretches to
many thousands of characters and still has limitations.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 29 Jun 2000 05:15:00 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: regex - slurp file and extract email addresses
Message-Id: <slrn8lm5uf.ka1.abigail@alexandra.delanet.com>

Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCDXCIV September
MCMXCIII in <URL:news:8jf3si$uft$1@orpheus.gellyfish.com>:
)) 
)) But people arent saying that what you are proposing is a worse way of
)) searching for e-mail addresses , they are saying that it isnt a way of
)) searching for *e-mail addresses* at all.  You might as well print every
)) line of the text with an '@' in it for all the hand cleaning you are
)) going to have to do with your data (and even that isnt foolproof as the
)) address might easily have a newline in it).


And let's not forget, not every address has a @ in it.



Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


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

Date: 29 Jun 2000 09:04:20 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: regex and hashes
Message-Id: <8jevu4$hip$1@orpheus.gellyfish.com>

On Wed, 28 Jun 2000 16:21:19 +0100 Chris Denman wrote:
> The words have to be stored 'as is' unfortunately.
> 
> The real problem is that I have a massive dictionary hash of every unique
> word that exists in a database.  I am writing an indexing system so that I
> can get to the data very quickly.  Seems to have backfired!
> 
> i.e.
> 
> $words{'abacus'}='1,2,3';
> $words{'apple'}='4,5,6'
> $words{'Apple'}='5,6,7';
> 

You might consider then creating a second hash keyed on the lowercased
word whose value is an array containing the case variants :

 
my %index_hash;

push @($index_hash{lc $word  }), $word;

Then to retrieve:

  foreach my $variant ( @{$index_hash{ lc $word } )
  {
    print $words{$position}; # or whatever ...
  }

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Thu, 29 Jun 2000 16:42:41 +0800
From: hanhan <chkwok@unitech-com.com>
Subject: Re: Scheduled script
Message-Id: <395B0C01.80B2D421@unitech-com.com>

Would u explain the method  in NT more
Since I face the same problem in NT.
Thanks for your help
"Dr. Peter Dintelmann" wrote:

>     Hi,
>
> sinewave schrieb in Nachricht <3957C530.ABBE49A1@lineone.net>...
> >I want to somehow run a script on a daily basis that will automatically
> >generate and send e-mails where someone has posted their email details.
> >What is the best way of doing this.
>
>     depends on the OS you are running.
>
>     1. On any flavor of UNIX you will find cron. See the man pages
>     for cron, crontab...
>     2. On NT use the scheduler service and the command line at
>     utility or the more friendly winat from the NT resource kit.
>
>     Sending email from Perl can be done with several modules.
>     The simplest one is Net::SMTP. Have a look at CPAN.
>
>     Best regards,
>
>         Peter Dintelmann



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

Date: 28 Jun 2000 23:22:20 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: sending SMS
Message-Id: <8jdtqs$bpa$1@orpheus.gellyfish.com>

On Wed, 28 Jun 2000 13:10:51 +0200 Chris M. Wagner wrote:
> Hi, is it possible to send a SMS using perl?
> 

This was discussed last week - check out Deja News .

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Thu, 29 Jun 2000 08:49:27 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Strange behaviour in upper case conversion
Message-Id: <395b077a.69690459@news.grnet.gr>

Hi. I'm trying to learn something about regex use in Perl and I came
across a curious problem. I started with something simple:

($name = $name) =~ tr/[a-z]/[A-Z]/;

This converts $name to upper case. Fine.

Now suppose I want to make just the first letter upper case and leave
the rest as it is. From what I've read in perlop and perlre, the ^
operator should match just the first character of the string. So

($name = $name) =~ tr/^[a-z]/[A-Z]/;

should do the job. Right? Wrong. What it does is convert the whole
string to upper case _and_ bump each character up by one ASCII code,
thus 'foo' becomes 'GPP', etc. Can anyone explain this?

My aim is to find something that formats names in a consistent way
from user input, so that

fiRsTnAmE LaStNaME would become

Firstname LASTNAME.

The reason I'm doing it this way is because I work in a bilingual
environment and uc() and lc() don't work for the Greek character set,
(e.g. join( '',uc( substr( $first,0,1)), lc(substr($first,1))  works
in English, but not in Greek), whereas my first example works in both
languages (if I add the Greek character ranges, of course).

Incidentally, my second attempt above, when modified to include Greek,
does the same as before, except that some Greek letters are bumped up
by one and others by two ASCII codes. Bizarre!

I'm sure this will seem quite simple to you gurus. All help
appreciated.

Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer


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

Date: Thu, 29 Jun 2000 09:58:42 +0000
From: redtux <mike@cyborg-group.com>
Subject: Subject using Net::SMTP
Message-Id: <962269123.724.0.nnrp-11.9e986064@news.demon.co.uk>

Hi 
Is there a way using Net::SMTP to get messages to have a subject field that
 will appear in the Subject header of an e-mail client.

All I hve managed to get so far is Subjecct etc appearing in the body of the 
message


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

Date: Thu, 29 Jun 2000 11:19:25 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: Subject using Net::SMTP
Message-Id: <8jf49e$9f12@intranews.dresdnerbank.de>

    Hi,

redtux schrieb in Nachricht
<962269123.724.0.nnrp-11.9e986064@news.demon.co.uk>...
>Is there a way using Net::SMTP to get messages to have a subject field that
> will appear in the Subject header of an e-mail client.

    you have to supply your own stmp headers.
    Just include "Subject: <your subject" in your
    headers. For details check out my other posts to
    this newsgroup.

        Peter Dintelmann






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

Date: Thu, 29 Jun 2000 05:39:09 GMT
From: "Cooljazz" <cooljazz.nospam@flash.net>
Subject: Re: Teen Volenteers WANTED
Message-Id: <1iB65.1498$7%3.115810@news.flash.net>

I am... and judging from how you adults are flaming, I think I'll stay a
teenager...

cooljazz




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

Date: Thu, 29 Jun 2000 08:24:24 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Teen Volenteers WANTED
Message-Id: <395b012f.916423@news.skynet.be>

Cooljazz wrote:

>and judging from how you adults are flaming, I think I'll stay a
>teenager...

It's not your choice.

-- 
	Bart.


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

Date: Thu, 29 Jun 2000 11:48:41 +0200
From: BMI Amsterdam <J.J.Settels@amc.uva.nl>
Subject: Unix Login on WNserver
Message-Id: <395B1B79.349E3B32@amc.uva.nl>

I'm using a Perl script as a CGI script for internet. The script is
running on a WNserver. I've made some resticted dirs for serveral
different users. Now I want a script that asks the user a username and
password and with that show a page that is on the restricted area.

Is this possible?

Greetz Bas



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

Date: Wed, 28 Jun 2000 23:04:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Where do uninitialized values come from?
Message-Id: <slrn8llf6r.2ge.tadmc@magna.metronet.com>

On Thu, 29 Jun 2000 01:34:16 GMT, Fred Bartlett <fbartlet@optonline.net> wrote:

>While this doesn't seem to make any difference to the correct output of
>my little script, I would like to know what causes the warning.


That is a very good attitude. You should fix your program
so that it does not generate the warning.


All of the messages that perl might issue are documented
in the perldiag.pod standard doc.


>When I run my script with -w, I get warnings of the form
>  Use of uninitialized value at HashIt.pl line 67.


   perldoc perldiag


--------------------------------
=item Use of uninitialized value%s

(W uninitialized) An undefined value was used as if it were already defined.  
It was
interpreted as a "" or a 0, but maybe it was a mistake.  To suppress this
warning assign a defined value to your variables.
--------------------------------


When perl says "uninitialized value", think "undef".


>When I don't use -w, I don't get warned.


But your program _is_ still using undef as if it was a real
value, you just aren't hearing about it anymore.


>Now, line 67 is the 4th line below:
>
>            if($level > 1){
>                for($i=1 ; $i < $level ; $i++){
>                    last if (($ArrayIndex-$i) < 0);
>                    $combinedTag=$startTags[$ArrayIndex -
>$i].$combinedTag;


You have 4 variables there that might cause the warning.

One of them is undef.

   $ArrayIndex
   $i                # I think we can rule this one out  :-)
   $combinedTag
   $startTags[$ArrayIndex -$i]


I'm guessing that

   $ArrayIndex - $i > $#startTags

is the problem (you're past the end of the array).


>The purpose of this script is to show the nesting of tags in an sgml
                                           ^^^^^^^^^^^^^^^

Tags cannot nest.

Elements can nest.

You are using incorrect terminology.

Tags are delimited by '<' and '>". So a "nested tag" would
be something like:

   <para <italic>>


Elements are delimited by a "start tag" and an "end tag".


Tags are merely delimiters. 

It is the _element_ that is of primary interest/value.


>file; $level holds the depth of the nesting. Before we reach this point,
>$combinedTag has been given the value of the current tag. $startTags is
>an array that has all the start tags from the SGML file; 
                   ^^^     ^^^^^^^^^^


Except the ones that have EMPTY declared content, I trust.


>they are popped
>off as end tags are encountered.
>
>I would have thought that the presence of the "last if" test would have
>prevented any uninitialized values; obviously, I thought wrong.


First, it only "tests" 2 of the 4 variables.

Second, it only tests for walking past one end of the array. You
could pass that test and still access beyond the other end.

Third, the way to test for undef is with the defined() function.


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


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

Date: Thu, 29 Jun 2000 05:40:22 GMT
From: Fred Bartlett <fbartlet@optonline.net>
Subject: Re: Where do uninitialized values come from?
Message-Id: <395AE135.928B6F4F@optonline.net>

Thanks for the help, everybody. undefined was what I needed.

(And sorry for the incorrect terminology: my working environment is
quite hermetic, so I've not trained my vocabulary as well as I should
have. Yes, it is _elements_ that are of interest, and, yes, I took care
of the empty ones.)

Fred


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

Date: Thu, 29 Jun 2000 10:30:33 +0200
From: "Hubert Ming" <hubert.ming@iggi.lu.ch>
Subject: while-loop and regex question
Message-Id: <8jf1cg$rou$1@pollux.ip-plus.net>

dear perl-gurus,
i don't understand how this function works. can you please give me further
explanation:

my ($res) = "";
while ($_[0] =~ /(.{1,45})/gs)
         {
         $res .= substr(pack('u', $1), 1);
         chop($res);
         }

thanx alot
hubert







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

Date: Thu, 29 Jun 2000 17:55:30 +1000
From: "Amri, Kuross [WOLL:4009-I:EXCH]" <kamri@asiapacificm01.nt.com>
Subject: Why am I not picking up anything from a datafile?
Message-Id: <8jev9t$63n$1@bcrkh13.ca.nortel.com>

Hello all,

I have a datafile that has content, permissions etc. Why isn't this in a
perl script picking anything up, when run from either command line or web
server?
THANKS.


   open (FILE, "<$datafile") or die "Can't open $datafile: $!";
   while (<FILE>) {
      print TMP;
      print;




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

Date: Thu, 29 Jun 2000 09:50:59 +0100
From: "BROADSPEED Online Support" <support@broadspeed.com>
Subject: Re: Why am I not picking up anything from a datafile?
Message-Id: <395b12da.0@london.netkonect.net>

Do you have another filehandle open for writing to, called TMP?

If not, I would suggest that you remove the "print TMP;" line, so the code
becomes as follows:

open (FILE, "<$datafile") or die "Can't open $datafile: $!";
while (<FILE>) {
    print;
}

Don't forget to close the while loop with '}' also!

Rgds, Trevor

Amri, Kuross [WOLL:4009-I:EXCH] <kamri@asiapacificm01.nt.com> wrote in
message news:8jev9t$63n$1@bcrkh13.ca.nortel.com...
> Hello all,
>
> I have a datafile that has content, permissions etc. Why isn't this in a
> perl script picking anything up, when run from either command line or web
> server?
> THANKS.
>
>
>    open (FILE, "<$datafile") or die "Can't open $datafile: $!";
>    while (<FILE>) {
>       print TMP;
>       print;
>
>




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

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


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