[14053] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1463 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 23 06:05:34 1999

Date: Tue, 23 Nov 1999 03:05:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <943355117-v9-i1463@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 23 Nov 1999     Volume: 9 Number: 1463

Today's topics:
    Re: [JOB]: Web Developer/Senior Web Developer: SGML, XM (Christopher R. Maden)
    Re: [JOB]: Web Developer/Senior Web Developer: SGML, XM <gellyfish@gellyfish.com>
        A tiny shell written in Perl <wsong@ece.uci.edu>
    Re: A tiny shell written in Perl (Abigail)
    Re: A tiny shell written in Perl <Joachim.Pimiskern@de.bosch.com>
    Re: Assigning a Match to a Scalar (Tad McClellan)
        Assigning an element of n associat. array to a scalar v <pullen@one.net.au>
    Re: Can Perl read gif pixels? (Martien Verbruggen)
    Re: can someone tell what this code does <bwalton@rochester.rr.com>
        Change password via cgi script <eastwoodch@yahoo.com>
    Re: Change password via cgi script <slanning@bu.edu>
    Re: Change password via cgi script (Abigail)
    Re: Concatenating a string (Tad McClellan)
        converting between OEM and ANSI ASCII char set <lyl2@np.edu.sg>
        converting between OEM and ANSI ASCII char set <lyl2@np.edu.sg>
    Re: Deleting or Unlinking a file help <lakesoft@skypoint.com>
    Re: Deleting or Unlinking a file help (Simon Cozens)
        Error using tar from cgi (rbj)
        help please, while wont....... <mattking@techie.com>
    Re: Help w/ DBI dbrah@my-deja.com
    Re: How do I take all of the email addresses out of an  (Matthew Bafford)
    Re: How do I take all of the email addresses out of an  (Tad McClellan)
    Re: How to write a uploaded file? <lr@hpl.hp.com>
    Re: How write records to ASCII file (Jan Andersen)
    Re: How write records to ASCII file (Abigail)
    Re: How write records to ASCII file (Jan Andersen)
    Re: How write records to ASCII file (Simon Cozens)
    Re: Infernal pattern matching. Why won't this work. (Helgi Briem)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 23 Nov 1999 02:27:24 -0800
From: crism@exemplary.net (Christopher R. Maden)
Subject: Re: [JOB]: Web Developer/Senior Web Developer: SGML, XML, PERL5, LINUX
Message-Id: <crism-2311990227240001@pm3b-45.meer.net>

In article <slrn83j8gf.6u1.dha@panix.com>, dha@panix.com (David H. Adler) wrote:
> You have posted a job posting or a resume in a technical group.

You have failed to read the charter and/or FAQ for this newsgroup.

Job postings, if on-topic, succinct, and clearly labeled, are appropriate
for this newsgroup.

Yours for a more clueful USENET,
Chris
-- 
Christopher R. Maden, Solutions Architect
Exemplary Technologies
One Embarcadero Center, Ste. 2405
San Francisco, CA 94111


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

Date: 23 Nov 1999 10:41:37 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: [JOB]: Web Developer/Senior Web Developer: SGML, XML, PERL5, LINUX
Message-Id: <383a6f61_1@newsread3.dircon.co.uk>

In comp.lang.perl.misc Christopher R. Maden <crism@exemplary.net> wrote:
> In article <slrn83j8gf.6u1.dha@panix.com>, dha@panix.com (David H. Adler) wrote:
>> You have posted a job posting or a resume in a technical group.
> 
> You have failed to read the charter and/or FAQ for this newsgroup.
> 
> Job postings, if on-topic, succinct, and clearly labeled, are appropriate
> for this newsgroup.
> 

Er to which of the 5 groups to which this was posted are you referring ?

/J\
-- 
"The Tory Party is like a wonky shopping trolley - it pulls to the
left, it pulls to the right, but you just can't get it to go forward"
- John Prescott


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

Date: Mon, 22 Nov 1999 23:18:49 -0800
From: "Song Wang" <wsong@ece.uci.edu>
Subject: A tiny shell written in Perl
Message-Id: <81dfam$pj3@news.service.uci.edu>

Hi, Folks

I want to use Perl to write a tiny shell which includes
the following functionalities:
(1) executing a small set of commands, probably with arguments.
(2) autocompletion of those commands.
(3) executing a script containing commands.

I don't know if CPAN has already had this kind of Perl modules.
Any pointers to this kind of tiny shell are appreciated.


-Minnow




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

Date: 23 Nov 1999 03:06:54 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: A tiny shell written in Perl
Message-Id: <slrn83kmfk.m2v.abigail@alexandra.delanet.com>

Song Wang (wsong@ece.uci.edu) wrote on MMCCLXXV September MCMXCIII in
<URL:news:81dfam$pj3@news.service.uci.edu>:
__ 
__ I want to use Perl to write a tiny shell which includes
                         ^^^^^
__ 
__ I don't know if CPAN has already had this kind of Perl modules.
__ Any pointers to this kind of tiny shell are appreciated.


I dunno, but grabbing something from CPAN isn't writing in my book.

Anyway, if you want to know whether something is on CPAN, go to 
CPAN, search the module list. It's there for a reason.




Abigail
-- 
perl -wlne '}print$.;{' 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: Tue, 23 Nov 1999 11:26:23 +0100
From: Joachim Pimiskern <Joachim.Pimiskern@de.bosch.com>
Subject: Re: A tiny shell written in Perl
Message-Id: <81dq4e$rhp$1@proxy2.fe.internet.bosch.de>

Minnow,

>I want to use Perl to write a tiny shell which includes
>the following functionalities:
>(1) executing a small set of commands, probably with arguments.
>(2) autocompletion of those commands.
>(3) executing a script containing commands.
>
>I don't know if CPAN has already had this kind of Perl modules.
>Any pointers to this kind of tiny shell are appreciated.


Parse::yapp and Parse::Lex is what you are searching for.

Joachim





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

Date: Mon, 22 Nov 1999 20:48:37 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Assigning a Match to a Scalar
Message-Id: <slrn83jsjl.a3l.tadmc@magna.metronet.com>

On Mon, 22 Nov 1999 18:21:16 -0800, Matthew Polly <mpolly@tathata.net> wrote:

>how can I assgn $price = 30 ?


   my $price = $1 if /\$(\d+)/;


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


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

Date: Tue, 23 Nov 1999 20:55:54 +1100
From: "Andrew Bleakley" <pullen@one.net.au>
Subject: Assigning an element of n associat. array to a scalar variable
Message-Id: <383a63ee@pink.one.net.au>

I have parsed the information from a form and assigned the name/value pairs
to assoc. array formdata.
I then need to assign the value associated with 'name' to variable called
$user_name. I cannot seem to make the assignment. Any help would be
appreciated.





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

Date: Tue, 23 Nov 1999 05:35:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Can Perl read gif pixels?
Message-Id: <aIp_3.515$qI1.6873@nsw.nnrp.telstra.net>

On Tue, 23 Nov 1999 15:42:04 +1100,
	Ron Savage <ron@savage.net.au> wrote:
> Proceed to http://www.wizards.dupont.com/cristy/www/magick-list.html
> 
> Subscribe, then install ImageMagick and then Perl::Magick, perhaps according
> to the tutorial on my web site.

Image::Magick gives you the possibility to easily walk over the pixels
of an image?

You can use $im->Get('columns', 'rows'), have two loops
inside of each other, and use Get and pixel[x,y], but isn't that
terribly slow? Or do you know of a better way with Image::Magick?

Maybe use Image::Magick to convert to PNG, and use GD to do the work
:)

Martien
-- 
Martien Verbruggen              | My friend has a baby. I'm writing
Interactive Media Division      | down all the noises the baby makes so
Commercial Dynamics Pty. Ltd.   | later I can ask him what he meant -
NSW, Australia                  | Steven Wright


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

Date: Tue, 23 Nov 1999 00:14:53 -0500
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: can someone tell what this code does
Message-Id: <383A22CD.E7D69172@rochester.rr.com>

"Matthew H. Devlin III" wrote:
 ...
> The part I dont
> get is the two lines beginning "select". Can someone explain please.
 ...
>   select((select(LOG), $| = 1)[0]);
>   select((select(STDOUT), $| = 1)[0]);

These statements proceed with execution as follows, using the
first one as an example:

First, the inner list (select(LOG),$|=1) is evaluated.  This list
has two elements.  The first element is executed, resulting
in filehandle LOG being selected, with a return value of the
filehandle that was selected prior to execution of the select.
Then the second list element $|=1 is executed, resulting in the
filehandle LOG being set to autoflush.  If you don't know what
that is, look it up in perlvar.  Then the [0] after the list
picks the 0'th element of the list (the first element), which,
if you recall, is the filehandle selected prior to the start
of execution of this statement.  This is then the argument to
another call to select, which causes the filehandle specified
in its argument to be selected.  That, if you recall from above,
is the filehandle that was selected prior to execution of this
statement.

Thus, these statements cause a specified filehandle to be set
to autoflush, without changing the selected filehandle.

My guess as to why your program appears to not work when
filehandle LOG is not set to autoflush is that the program
of which this is a part is a non-terminating program (that
is, it keeps running while other programs continue).  It writes
a few things to the LOG filehandle, but not enough to generate
a full buffer (typically about 8K bytes) very often.  Without 
autoflushing, it appears like your program isn't writing anything
to the LOG filehandle.  It actually is, it is just that you don't
see it until a whole buffer of output is generated.  If you wait
long enough, or generate enough LOG output, a bunch of it will
suddenly appear.  Turning on autoflush makes Perl write out
each print statement's output without waiting for the buffer
to fill.  Autoflush is off by default for efficiency, but needs
to be turned on in cases like this one.

 ...
> Matthew H. Devlin III
> Informix Database Administrator / Sysadmin
> www.ReserveAmerica.com
> 
> Home: (518)893-0637
> Office: (518)885-4282 eXT: 2237
-- 
Bob Walton


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

Date: Tue, 23 Nov 1999 15:11:16 +0800
From: Scootty <eastwoodch@yahoo.com>
Subject: Change password via cgi script
Message-Id: <383A3E14.2B8E877D@yahoo.com>

Hi all,

How to write the cgi script that using the command 'passwd' for users
can change
their password of unix system from the net?

Thanks



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

Date: 23 Nov 1999 03:57:06 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: Change password via cgi script
Message-Id: <kuszow5k2l8.fsf@strange.bu.edu>

Scootty <eastwoodch@yahoo.com> writes:
> How to write the cgi script that using the command 'passwd' for
> users can change their password of unix system from the net?

Go directly to comp.infosystems.www.authoring.cgi.
Do not pass Go.
Do not collect $200.

(but seriously, if you don't already know how to write it,
reconsider--for the sake of your system's security--whether you
actually want to write it. If so, make sure to read something
like Lincoln Stein's CGI security document or similar.)


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

Date: 23 Nov 1999 03:09:40 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Change password via cgi script
Message-Id: <slrn83kmkq.m2v.abigail@alexandra.delanet.com>

Scootty (eastwoodch@yahoo.com) wrote on MMCCLXXV September MCMXCIII in
<URL:news:383A3E14.2B8E877D@yahoo.com>:
`` Hi all,
`` 
`` How to write the cgi script that using the command 'passwd' for users
`` can change
`` their password of unix system from the net?


      print "<p>Please come see me at my desk right away."
      print "<p>The Sysadmin."


What you want sounds like a bad idea. Specially if you have to ask how.



Abigail
-- 
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}


  -----------== 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: Mon, 22 Nov 1999 20:55:03 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Concatenating a string
Message-Id: <slrn83jsvn.a3l.tadmc@magna.metronet.com>

On Sun, 21 Nov 1999 23:39:24 -0600, Hilaire deSa <hdesa@bellsouth.net> wrote:

>Wanted to know the cleanest way to concatenate a Space (" ") after a string.
                                    ^^^^^^^^^^^
                                    ^^^^^^^^^^^

   # do a word search in the docs that came with perl
   cd /dir/where/pods/are/
   perl -ne 'print "$ARGV: $_" if /concatenate/' *.pod

   That finds 7 lines, I'll bet one of those would answer your question.

   And it would have taken you less time than it did to type
   up your post.

   Work smart. Use the resources on your own hard disk.

  
>$MyString = $ARGV[0] + " ";
>
>Obvious the above does not work. How best can I do it.


perlop.pod: Binary "." concatenates two strings.


   But that is not what I would call "the cleanest" way, for that
   I would go with:

      $MyString = "$ARGV[0] ";


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


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

Date: 23 Nov 1999 15:26:54 +0800
From: "William" <lyl2@np.edu.sg>
Subject: converting between OEM and ANSI ASCII char set
Message-Id: <383a41be.0@nsuxnews>


I am currently in need of a method to convert between OEM and ANSI
Ascii Character set. This is becoz there is a difference in values
after ASCII numeric 127. 
Eg, 135 yields ç in OEM ASCII 



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

Date: 23 Nov 1999 15:31:38 +0800
From: "William" <lyl2@np.edu.sg>
Subject: converting between OEM and ANSI ASCII char set
Message-Id: <383a42da.0@nsuxnews>


Please send all help to lyl2@np.edu.sg ...THanks! :)

I am currently in need of a method to convert between OEM and ANSI
Ascii Character set. This is becoz there is a difference in values
after ASCII numeric 127. 
Eg, the character ç
yields OEM Ascii Numeric 135
but in ANSI Ascii Numeric it is 231.

The problem now is that whevener I used ord/chr to convert a txt
file which is based on OEM ASCII. It will give me a numeric ANSI
ASCII of 231. This numeric value is important to me as I need to
use it to do some arithmetic operation.

So , my question is How do I make perl generate OEM ASCII Value
instead of ANSI ASCII. Hope you guys understand my question. keke

Thanks..and regards.


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

Date: Sat, 20 Nov 1999 13:47:05 -0600
From: "Jonathan A. Laub" <lakesoft@skypoint.com>
Subject: Re: Deleting or Unlinking a file help
Message-Id: <816u1j$1l6k$1@shadow.skypoint.net>

This newsgroup is about PERL, not format-correct posting..get enough of that
crap at work.

Anyway, I did manage to figure out why files that are stored in $vars are
not deleted correctly.  Do not know exactly why but here is the solution:

1. You must install an "until file does not exist" loop.
2. This will execute until the alias is closed and unlinked.
3. Maybe it's a problem related to being run on a P600?? NT environment???

Jon

     #
     ### THIS WORKS TO DELETE THE INPUT FILES FROM CLIPPER.
     #
     $kill= ("$xCOUNT.INP");         // PUT FILE TO DELETE INTO A NEW $VAR.
     print "</body>\n</html>\n";     // THIS MY LAST LINE WRITTEN TO THE
HTML.
     until (!(-e"$xCOUNT.inp")){    // THE LOOP UNTIL THE FILE DOES NOT
EXIST ANYMORE!
           close(newfile);                   // CLOSE THE ALIAS
           $file_to_go = ($kill);          // THIS IS PROBABLY OPTIONAL -
SINCE NO CHANGES HAVE BEEN MADE.
           unlink ($file_to_go)           // ATTEMP TO DELETE/UNLINK THE
FILE. -- GOOD LUCK!
     }




HHH wrote in message <38359CE5.FCFC2B07@westat.com>...
>Uri Guttman wrote:
>> >>>>> "J" == Jakob  <asd@ds.aw> writes:
>>   J> Well I guess managed to offend you just a little bit then.
>> oooooooh! i will never post here again! i have been hurt to the bone
by....
>
>Or, as we tell our three year-old, "you're right, Philadelphia _is_ the
>capital of Belgium."
>
>HHH




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

Date: 23 Nov 1999 10:15:49 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: Deleting or Unlinking a file help
Message-Id: <slrn83kqal.3i8.simon@othersideofthe.earth.li>

Jonathan A. Laub (comp.lang.perl.misc):
>This newsgroup is about PERL

What would that be then?

>     $kill= ("$xCOUNT.INP");         // PUT FILE TO DELETE INTO A NEW $VAR.

There's something about your comments I don't quite get. IT'S NOT JUST THAT YOU
TALK LIKE THIS, though. I think you're confusing matching an empty
regexp with... uh, something else.


-- 
fga is frequently given answers... the best are "Date::Calc", "use a hash",
and "yes, it's in CPAN" or Data::Dumper or mySQL or "check your permissions"
or NO Fmh THAT'S WRONG or "You can't. crypt is one-way" or "yes, i'm single"
or "I think that's a faq." or substr! or "use split" or "man perlre" - #perl


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

Date: Mon, 22 Nov 1999 17:29:52 GMT
From: rbj@hotmail.com (rbj)
Subject: Error using tar from cgi
Message-Id: <38397c39.11313558@ny.news.verio.net>

I have a cgi script creating some text files. After the files are
created the script executes 

$cmd = "tar -cvf $tmp_dir"."test.tar $tmp_dir"."*.txt";
$rc = system($cmd);

Which failes (256), creating test.tar size 0.

Running same tar command in telnet works fine.
Running script in telnet runs fine.

All text files have owner 'nobody nobody' with read for all.
The perl cgi has 'my-id my-grp' ownership.

Is this a priviledge problem?

Thanks


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

Date: Tue, 23 Nov 1999 11:10:52 +0100
From: "Matt King" <mattking@techie.com>
Subject: help please, while wont.......
Message-Id: <81dp6b$e96$1@news.uk.ibm.com>

Hello. I have a question that has been asked by othere people before, one of
the answers was to a question almost identical to mine. The answer didn't
help me, but since the orginal appender didn't come back, it looks like it
helped him. What I have is a script to upload files from an html page
(please don't tell me to go to the comp.infosystems.www.authoring.cgi, this
is an error directly related to PERL programming since the script is
receiveing everything is should, it's just not doing what it should). The
problem is, is that the script creates a 0 byte file and does not preform
the upload. Using the information from the other appends I have rewritten
the script, but the error remains. Here is the portion of the script that is
not working. Can someone point out where the error, thanks.


if (!open(OUTFILE, ">$SAVE_DIRECTORY\/$Filename")) { &errormessage;  }
binmode OUTFILE;
undef $BytesRead;
undef $Buffer;

#### Here is the error location, everything else apears to work
correctly......

while ($Bytes = read($File_Handle,$Buffer,1024)) {
  $BytesRead += $Bytes;
  print OUTFILE $Buffer;
}

####

push(@Files_Written, "$SAVE_DIRECTORY\/$Filename");
$TOTAL_BYTES += $BytesRead;
$Confirmation{$File_Handle} = $BytesRead;

 ## Note I'm closing the files here, not anywhere else
close($File_Handle);
close(OUTFILE);
chmod (0666, "$SAVE_DIRECTORY\/$Filename");

I have not included the rest of the file, since it's not needed for this
problem, but to explain, there are portions that break down the input and
check to be sure something is present and well as setting up the upload dir
var and the file name to upload.

(do you really need the complete thing)

I hope someone can help here.......
Matt




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

Date: Tue, 23 Nov 1999 05:48:29 GMT
From: dbrah@my-deja.com
Subject: Re: Help w/ DBI
Message-Id: <81d9rd$8i7$1@nnrp1.deja.com>

I immediately see two typos. Line 1 should be #!/user/bin/perl, and line
2 needs ';' to be use DBI;


In article <slrn83jb5e.m2v.abigail@alexandra.delanet.com>,
  abigail@delanet.com wrote:
> Adam Levenstein (che@worker.com) wrote on MMCCLXXIV September MCMXCIII
in
> <URL:news:38393f39.402690722@news.psu.edu>:
> \\
> \\ #/usr/bin/perl -wT
> \\
> \\ use DBI
> \\ use CGI;
> \\ use strict;
> \\
> \\ Did I goof something? I think the problem is here.
>
> The second character of the first line is wrong.
>
> Abigail
> --
> perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
>
>   -----------== 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 ==-----
>


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


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

Date: Tue, 23 Nov 1999 10:40:00 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: How do I take all of the email addresses out of an email? 2 of 2 (fwd)
Message-Id: <slrn83kfil.qd.*@dragons.duesouth.net>

Once upon a time (Mon, 22 Nov 1999 20:17:14 -0800), David Cassell
<cassell@mail.cor.epa.gov> was attempting to figure out Ilya's new Perl
regex features, and accidently sent the following to
comp.lang.perl.misc: 
: Matthew Bafford wrote:
: [snip]
: > If that's the case, then a simple regular expression such as \w@\w.\w
: > will probably catch enough of them for you.                  ^^^^^^^^
:                                                                   |
: Huh???? -----------------------------------------------------------
: 
: Umm, actually Matthew *deliberately* corrupted his regex, so that
: spammers couldn't benefit from his expertise.

Actually, Matthew has no idea why Matthew did that.

But he will go along with your idea. :)

: David, also the president of Pathological Liars Anonymous...

Probably seen you at a meeting one time...

--Matthew


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

Date: Mon, 22 Nov 1999 12:43:27 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do I take all of the email addresses out of an email? 2 of 2
Message-Id: <slrn83j05v.9tj.tadmc@magna.metronet.com>

On Mon, 22 Nov 1999 15:29:25 -0500, Poohba <poohba@io.com> wrote:

>Thank you very much for your help. 


   You can show your appreciation by not sending stealth Cc'd emails.

   I don't answer emailed questions anyway.


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


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

Date: Mon, 22 Nov 1999 23:49:22 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: How to write a uploaded file?
Message-Id: <MPG.12a3e6d4778bbca298a258@nntp.hpl.hp.com>

In article <00n_3.8$7V4.1710@vic.nntp.telstra.net> on Tue, 23 Nov 1999 
12:01:24 +0930, Wyzelli <wyzelli@yahoo.com> says...
> <crackbaby1@my-deja.com> wrote in message
> news:81cj77$ohk$1@nnrp1.deja.com...
> >
> > $file_name = "c:\d.gif"; # a file a use needs to upload

> That won't work... "c:\\d.gif" or 'c:\d.gif'....

Well, yes.  But I use every opportunity to expose further the Best-Kept 
Secret of which most Windows/DOS programmmers are unaware:

    $file_name = 'c:/d.gif';

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


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

Date: Tue, 23 Nov 1999 08:05:23 GMT
From: jad@edekamapson.dk (Jan Andersen)
Subject: Re: How write records to ASCII file
Message-Id: <383a49ac.8204918@news.inet.tele.dk>

On Mon, 22 Nov 1999 21:23:08 +1100, Stephen J Whitfield
<rwhitfie@speedlink.com.au> wrote:

>open FILE, >>$filename or die "Could not open $filename: $!";
>print FILE "data\n";
>close FILE || die "Could not close $filename: $!";

Re: Perl style.

A newbie asks: Why do you change between 'or' and '||' ?

They are the same thing. Right?

Jan


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

Date: 23 Nov 1999 03:16:05 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: How write records to ASCII file
Message-Id: <slrn83kn0r.m2v.abigail@alexandra.delanet.com>

Jan Andersen (jad@edekamapson.dk) wrote on MMCCLXXV September MCMXCIII in
<URL:news:383a49ac.8204918@news.inet.tele.dk>:
`` A newbie asks: Why do you change between 'or' and '||' ?
`` 
`` They are the same thing. Right?


Right. Sure. Whatever. They are the same as <=> and -- too. Don't believe
the documentation. They are all commie lies. And you get green hands if
you read it too much. Just ask here, were the experts never get tired
of answering, and the newbies always test their answers.



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: Tue, 23 Nov 1999 09:46:18 GMT
From: jad@edekamapson.dk (Jan Andersen)
Subject: Re: How write records to ASCII file
Message-Id: <383a6194.14324407@news.inet.tele.dk>

On 23 Nov 1999 03:16:05 -0600, abigail@delanet.com (Abigail) wrote:

>Jan Andersen (jad@edekamapson.dk) wrote on MMCCLXXV September MCMXCIII in

What is "on 2275 September 1993" ? Is it in the documentation ;-)

>Right. Sure. Whatever. They are the same as <=> and -- too. Don't believe
>the documentation. They are all commie lies. And you get green hands if
>you read it too much. Just ask here, were the experts never get tired
>of answering, and the newbies always test their answers.

I know that 'or' has lower precedence than '||'. Otherwise they're the
same.

From perlop:
"As more readable alternatives to '&&' and '||' when used for
control flow, Perl provides 'and' and 'or' operators (see below).
The short-circuit behavior is identical.  The precedence of "and" and
"or" is much lower, however, so that you can safely use them after a
list operator without the need for parentheses:"

I just don't understand what need you have for a lower (or higher)
precedence on his open/close statements? What 'difference' does it
make?

In the 'commie' documentation for 'close' they use 'or' for both open
and close.

Jan


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

Date: 23 Nov 1999 10:49:01 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: How write records to ASCII file
Message-Id: <slrn83ks8t.3i8.simon@othersideofthe.earth.li>

Jan Andersen (comp.lang.perl.misc):
>On 23 Nov 1999 03:16:05 -0600, abigail@delanet.com (Abigail) wrote:
>>Jan Andersen (jad@edekamapson.dk) wrote on MMCCLXXV September MCMXCIII in
>What is "on 2275 September 1993" ? Is it in the documentation ;-)

Yes. Although *which* documentation is left for you to discern. It's
correct, anyhow.

-- 
"By golly, I'm beginning to think Linux really *is* the best thing since
sliced bread."
(By Vance Petree, Virginia Power)


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

Date: Tue, 23 Nov 1999 10:01:03 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Infernal pattern matching. Why won't this work.
Message-Id: <383a65c2.90079387@news.itn.is>

On Mon, 22 Nov 1999 15:33:04 GMT, *@dragons.duesouth.net
(Matthew Bafford) wrote:

>Simon:
>: Try it, try it:
>: 
>: perl -e 'print "It matches!\n" if "_" =~ /\w/"'
>: 
>: Left as an exercise.
>
>String found where operator expected at -e line 1, at end of line
>        (Missing semicolon on previous line?)
>Can't find string terminator '"' anywhere before EOF at -e line 1.
>
>--Matthew

Corrected version:
perl -e 'print "It matches!\n" if "_" =~ /\w/'

i.e. lose the extra "


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

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


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