[11267] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4867 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 10 22:07:20 1999

Date: Wed, 10 Feb 99 19:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 10 Feb 1999     Volume: 8 Number: 4867

Today's topics:
    Re: Calculate yesterdays date (Chad Dubuque)
    Re: change column of nmbers to 2 dim array (Martien Verbruggen)
    Re: change column of nmbers to 2 dim array (Abigail)
    Re: change column of nmbers to 2 dim array (Larry Rosler)
        Direcory listing (Cybernetic Bear)
    Re: Echoing Lines in PERL (Mark-Jason Dominus)
    Re: fun with strings... (Larry Rosler)
    Re: fun with strings... <uri@home.sysarch.com>
    Re: Graphs and gifs (Alastair)
    Re: Hex 0a always prints 0d followed by 0a joedevon@my-dejanews.com
    Re: Hex 0a always prints 0d followed by 0a (Alastair)
    Re: How do I delete a hash element ?? (Martien Verbruggen)
    Re: how do I get a date in perl? <mpersico@erols.com>
    Re: list comparison code? (Mark-Jason Dominus)
    Re: locking files <cwhung@china.com>
        Net-SSLeay on Windows NT? <stupakov@slac.stanford.edu>
    Re: Newbie from Intel Evil Empire wants to know how to  onewierdchild@hotmail.com
    Re: newbie perl and cgi question..... (Sam Holden)
    Re: Perl 'zine <carvdawg@patriot.net>
    Re: Perl and Microsoft Mail (Alastair)
    Re: PERL for Personal Web Server (Rohan Parkes)
    Re: Problem in writing the following expression in Perl (Larry Rosler)
    Re: Python vs. Perl vs. tcl ? <arcege@shore.net>
        The Computer Person's Prayer <jjarrett@ecpi.com>
    Re: win32::odbc error right out of the box (Martien Verbruggen)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 10 Feb 1999 19:19:41 -0600
From: cdubuque@rrnet.com (Chad Dubuque)
Subject: Re: Calculate yesterdays date
Message-Id: <79tb7d$e1s$1@rrnet.com>

In article <36C1D80E.4893@jpmorgan.com>,
Michael D. Hofer <mhofer@jpmorgan.com> wrote:
>M.J.T. Guy wrote:
>> 
>> Jarkko Hietaniemi  <jhi@alpha.hut.fi> wrote:
>> >
>> >Peter Webb <Peter.Webb@cern.ch> writes:
>> >
>> >> Is there a quick way of calculating yesterdays date?
>> >
>> >localtime(time()-86400)
>> 
>> As I keep repeating, that will give wrong answers for two hours each year
>> (in most places).
>> 
>> Mike Guy
>
>Luckily, neither of those hours span a month boundary (at least in the
>USA), so by comparing the day-of-the-month of both dates you can
>determine if you are playing with a ST/DT cusp.

Or, you could check the 9th element of the array localtime() returns: isdst.
If they are unequal, you know what's up.

However, it will give you the correct day, date, weekday, and all that jazz,
since the DST change happens at 2am.

Isn't this a FAQ somewhere? I'm sure it is...

-- 
Chad Dubuque       cdubuque@rrnet.com        Fargo, N.D. (USA)
Red River Net - Internet Communications  http://www.rrnet.com/


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

Date: Thu, 11 Feb 1999 01:25:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: change column of nmbers to 2 dim array
Message-Id: <Ojqw2.681$Uh.8112@nswpull.telstra.net>

In article <36C21705.B1C99A10@giss.nasa.gov>,
	Jay Glascoe <jglascoe@giss.nasa.gov> writes:
> "Randal L. Schwartz" wrote:
>> 
>> [THIS evil message was stealth-cc'ed to me.
>> 
>> EITHER DON'T COPY ME, or mark it as such.
>> 
>> Thank you.]
> 
> excuse me?  what?  did I break some rule of etiquette here?

Yes.

It is considered bad form to send a copy of a post to someone without
mentioning this in the body of the message (stealth CC). The reasons
that it is considered bad form is that people normally read their
email before they read Usenet. If they can't see that a message has
alos been posted, they may reply via email, while the reply really
belonged on Usenet, where everyone can benefit from it and comment on
it.

This is all explained in the Usenet etiquette documents that you can get
from almost anywhere.

So, either mention in the body of your message something like:

[Posted and emailed]

or don't CC the poster.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd.       | why kamikaze pilots wore helmets - Dave
NSW, Australia                      | Edison 


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

Date: 11 Feb 1999 01:46:50 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: change column of nmbers to 2 dim array
Message-Id: <79tcqa$47q$1@client2.news.psi.net>

Randal L. Schwartz (merlyn@stonehenge.com) wrote on MCMLXXXIX September
MCMXCIII in <URL:news:m1pv7hkhth.fsf@halfdome.holdit.com>:
"" 
"" [THIS evil message was stealth-cc'ed to me.
"" 
"" EITHER DON'T COPY ME, or mark it as such.
"" 
"" Thank you.]
"" 
"" >>>>> "Jay" == Jay Glascoe <jglascoe@giss.nasa.gov> writes:
"" 
"" Jay> "Randal L. Schwartz" wrote:
"" >> 
"" >> push @new, [splice @original, 0, 36] while @original;
"" 
"" Jay> huh...
"" 
"" Jay> map { [map { shift @original } (1..72)] } (1..36)
"" 
"" That's a use of map in void context, considered bad form by most.


First of all he isn't using map in void context, as the result of the
map is the result we're interested in. Just think there's a '@new = '
on the line above.

And whether or not map in a void context is considered bad form by most
doesn't matter. Your arguments against apparently don't matter for the
people maintaining perl, as otherwise, it would have been fixed a long
time ago.



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


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

Date: Wed, 10 Feb 1999 18:11:33 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: change column of nmbers to 2 dim array
Message-Id: <MPG.112bdc33783724c1989a18@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <36C21705.B1C99A10@giss.nasa.gov> on Wed, 10 Feb 1999 
18:32:21 -0500, Jay Glascoe <jglascoe@giss.nasa.gov> says...
> "Randal L. Schwartz" wrote:
> > 
> > [THIS evil message was stealth-cc'ed to me.
> > 
> > EITHER DON'T COPY ME, or mark it as such.
> > 
> > Thank you.]
> 
> excuse me?  what?  did I break some rule of etiquette here?
> 
> if randal won't explain... perhaps someone else will?

Certainly.  When someone receives email in response to a post, unless it 
is clearly marked as a copy of a new post they may well respond to it 
directly as email.  Then when the new post propagates, they may have to 
respond to it again publicly.  As you can see, this may cause some 
stress.

Many newsreaders, such as mine, include a configurable notice 
automatically (see above).

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


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

Date: Thu, 11 Feb 1999 00:23:25 GMT
From: cybear_x[nospam]@geocities.com (Cybernetic Bear)
Subject: Direcory listing
Message-Id: <36c222cb.95535104@news.webhart.net>

I need to know how to read in a list of the files in a directory. I
just need the file names for now.

Thanks
Dave


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

Date: 10 Feb 1999 21:43:46 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Echoing Lines in PERL
Message-Id: <79tg52$2vt$1@monet.op.net>

In article <rCkw2.63$DG2.22053@PM01NEWS>, JEDI <JEDI@xxx.com> wrote:
>Being new to PERL, is it possilble to echo back lines of a PERL
>script as it is executing? If so, how?

People have already said how to get what you probably really want,
which is a debugger.  But if for some reason you  want the
thing you actually asked for, you can get it from 

	http://www.plover.com/~mjd/perl/Trace/



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

Date: Wed, 10 Feb 1999 17:56:28 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: fun with strings...
Message-Id: <MPG.112bd8aa39c8e7ec989a16@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <39pv7hlsql.fsf@ibnets.com> on 10 Feb 1999 18:54:42 -0500, 
Uri Guttman <uri@ibnets.com> says...
> >>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:
> 
>   BL> The next one doesn't use eval either:
> 
>   BL> 	%replace = ( n => "\n", t => "\t");
>   BL> 	s/\\([nt])/$replace{$1}/g;
> 
> larry will have to add yours to the benchmark.

You could have too.  The source was posted. :-)

#!/usr/local/bin/perl -w
use Benchmark;
my $x =
'This is a string\nwith \tpseudo-tabs and \npseudo-newlines\t in it.\n';
my %replace = ( n => "\n", t => "\t" );

timethese(1 << (shift || 0), {
   Bart   => sub { $_ = $x; s/\\([nt])/$replace{$1}/g },
   Larry  => sub { $_ = $x; s/\\([nt])/$1 eq 'n' ? "\n" : "\t"/eg },
   Ronald => sub { $_ = $x; s/(\\[nt])/"\"$1\""/gee },
   Uri    => sub { $_ = $x; s/\\n/\n/g; s/\\t/\t/g },
});
__END__

Benchmark: timing 16384 iterations of Bart, Larry, Ronald, Uri...
      Bart:  2 wallclock secs ( 1.53 usr +  0.00 sys =  1.53 CPU)
     Larry:  1 wallclock secs ( 1.53 usr +  0.00 sys =  1.53 CPU)
    Ronald: 27 wallclock secs (26.58 usr +  0.00 sys = 26.58 CPU)
       Uri:  1 wallclock secs ( 0.70 usr +  0.00 sys =  0.70 CPU)

In article <36c31037.13038206@news.skynet.be> on Wed, 10 Feb 1999 
23:08:01 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Uri Guttman wrote:
> >i seem to be the only one who supplied a solution without the use of
> >eval.
> But you used repeated substitutons. Evil! (Though it's quite harmless in
> this particular case.)

Less than harmless, I would say!  And certainly not evil.

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


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

Date: 10 Feb 1999 21:14:33 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: fun with strings...
Message-Id: <x7n22lptyu.fsf@home.sysarch.com>

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

  LR> Uri Guttman <uri@ibnets.com> says...

  >> larry will have to add yours to the benchmark.

  LR> You could have too.  The source was posted. :-)

well i have just becomed spoiled by your doing it so often for us. :-)

  LR>    Bart   => sub { $_ = $x; s/\\([nt])/$replace{$1}/g },
  LR>    Larry  => sub { $_ = $x; s/\\([nt])/$1 eq 'n' ? "\n" : "\t"/eg },
  LR>    Ronald => sub { $_ = $x; s/(\\[nt])/"\"$1\""/gee },
  LR>    Uri    => sub { $_ = $x; s/\\n/\n/g; s/\\t/\t/g },

  LR>       Bart:  2 wallclock secs ( 1.53 usr +  0.00 sys =  1.53 CPU)
  LR>      Larry:  1 wallclock secs ( 1.53 usr +  0.00 sys =  1.53 CPU)
  LR>     Ronald: 27 wallclock secs (26.58 usr +  0.00 sys = 26.58 CPU)
  LR>        Uri:  1 wallclock secs ( 0.70 usr +  0.00 sys =  0.70 CPU)

  LR> Less than harmless, I would say!  And certainly not evil.

looks like s/// with constant strings is faster than grabbing and a hash
lookup or an expression.

uri

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


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

Date: Thu, 11 Feb 1999 02:14:53 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Graphs and gifs
Message-Id: <slrn7c4fb5.65.alastair@calliope.demon.co.uk>

Richard H <rhrh@hotmail.com> wrote:
>Hi, 
>Can anyone point me towards a graph plotting module, Im running on UNIX
>and GD/GIFgraph arent flexible enough to allow xy scatter graphs
>thanks,
>richard H

Maybe one of these?

cpan> d /gif/ 
Distribution    M/MP/MPOCOCK/GIFgraphExtensions-1.0.tar.gz
Distribution    MVERB/GIFgraph-1.10.tar.gz

cpan> d /graph/
Distribution    D/DI/DIONALM/Geography-USStates-0.10.tar.gz
Distribution    DDUMONT/Tk-TreeGraph-1.005.tar.gz
Distribution    JHI/Graph-0.001.tar.gz
Distribution    JHI/Graph-0.005.tar.gz
Distribution    M/MP/MPOCOCK/GIFgraphExtensions-1.0.tar.gz
Distribution    MVERB/GIFgraph-1.10.tar.gz
Distribution    NEILB/graph-modules-1.001.tar.gz
Distribution    SFARRELL/Text-Graphics-1.0001.tar.gz
Distribution    SMCCAM/B-Graph-0.50.tar.gz
Distribution    STBEY/Graph-Kruskal-2.0.tar.gz

cpan> d /plot/ 
Distribution    ILYAZ/modules/Term-Gnuplot-0.55.tar.gz
Distribution    J/JL/JLAPEYRE/libplot-perl-2.1.6.2b.tar.gz
Distribution    KGB/PGPLOT-2.11.tar.gz
Distribution    N/NP/NPESKETT/Chart-GnuPlot-0.02.tar.gz
Distribution    S/SM/SMORTON/Chart-Plot-0.07.tar.gz

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 11 Feb 1999 01:34:49 GMT
From: joedevon@my-dejanews.com
Subject: Re: Hex 0a always prints 0d followed by 0a
Message-Id: <79tc3p$mk3$1@nnrp1.dejanews.com>

It works! Thanks very much...

In article <36c20df0.12455397@news.skynet.be>,
  bart.lateur@skynet.be (Bart Lateur) wrote:
> joedevon@my-dejanews.com wrote:
>
> >How do I cause perl to write oa only? The code:
> >$line = $_."\x0a";
> >print FILE $line;
> >
> >and I get an 0d and 0a!!! I want 0a only!
>
> You on PC?
>
> If so, set the output handle to binary, using binmode().
>
> 	Bart.
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 11 Feb 1999 02:06:23 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Hex 0a always prints 0d followed by 0a
Message-Id: <slrn7c4er8.65.alastair@calliope.demon.co.uk>

Bart Lateur <bart.lateur@skynet.be> wrote:
>
>You on PC?

Hm. I'm on a PC but I don't have to use 'binmode'. You mean using DOS/Windows
probably. Sorry for splitting hairs!

Bye.


-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 11 Feb 1999 01:27:33 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How do I delete a hash element ??
Message-Id: <9mqw2.683$Uh.8112@nswpull.telstra.net>

In article <79suim$acg$1@nnrp1.dejanews.com>,
	paulosa@gcm.com writes:
> I tried "undef" does not work.
> 
> ex:
> 
> $hash{test} = "test";
> undef $hash{test};

Ahem. Did you read the documentation?

# perldoc -f undef
[snip]
(Saying C<undef $hash{$key}>
will probably not do what you expect on most predefined variables or
DBM list values, so don't do that; see L<delete>.)

# perldoc -f delete

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: Wed, 10 Feb 1999 21:52:07 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: how do I get a date in perl?
Message-Id: <36C245D7.AF0536A5@erols.com>

Why not just ask her? :-)

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: 10 Feb 1999 21:41:41 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: list comparison code?
Message-Id: <79tg15$2up$1@monet.op.net>

In article <QCjw2.61$DG2.21465@PM01NEWS>,
Monty Scroggins <Monty.Scroggins@mci.com> wrote:
>Does anyone have a snippet of code that would perform the
>equivilent of the unix "comm" command?   I would like to
>compare two lists (A and B) and generate three output lists

Comm will only work on sorted lists, remember.  If that's what you
want, here it is.  If not, pick up a copy of my diff module from
	http://www.plover.com/~mjd/perl/diff/ 



#!/usr/bin/perl
#
# comm
#
# 1999 M-J. Dominus (mjd-perl-comm@plover.com)
# Public domain.
#
@COL[1,2,3] = (1,1,1);

if ($ARGV[0] =~ /^-[123]+$/) {
  $opt = shift;
  while ($opt =~ /[123]/g) {
    $COL[$&] = 0;
  }
}

unless (@ARGV == 2) {
  die "Usage: comm [-123] file1 file2\n";
}

open F1, "< $ARGV[0]"
  or die "comm: Couldn't open file $ARGV[0]: $!\n";
open F2, "< $ARGV[1]"
  or die "comm: Couldn't open file $ARGV[1]: $!\n";

$r1 = <F1>;
$r2 = <F2>;

while (defined $r1 && defined $r2) {
  if ($r1 eq $r2) {
    print "\t\t", $r1 if $COL[3];
    $r1 = <F1>;
    $r2 = <F2>;
  } elsif ($r1 gt $r2) {
    print "\t", $r2 if $COL[2];
    $r2 = <F2>;
  } else {
    print $r1 if $COL[1];
    $r1 = <F1>;
  }
}

print $r1 if defined $r1 && $COL[1];
print "\t", $r2 if defined $r2 && $COL[2];
if ($COL[1]) { print while <F1> }
if ($COL[2]) { print "\t", $_ while <F2> }



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

Date: Thu, 11 Feb 1999 09:32:09 +0800
From: Dino Hung <cwhung@china.com>
To: Paul Williams <paul@rainbow.nwnet.co.uk>
Subject: Re: locking files
Message-Id: <36C23319.441D54A6@china.com>

Hi,

I have a script that is executed by a cgi program :

 ...
open(LOCK,">>file.txt");
flock(LOCK,2);
seek(LOCK,0,2);
< do something ..... >
close(LOCK);
 ....

and the cgi program is killed before closing the file, close(LOCK). Then
this cgi program is executed again and it holds itself. It seems that the
cgi is waiting for the unlock of 'file.txt', which is locked in the last
time. So how can I do now so that the locked file, 'file.txt' can be
unlocked even if the cgi program terminates before unlocking the file ??

Thanks,
Dino

Paul Williams wrote:

> Chris has explained it pretty well but I thought you might like to
> know of a function which is available to perl without writing and then
> checking the existance of a file ... flock();
>
> A problem which may arise with checking for the existance of a file
> though may be that the script might terminate before it had a chance to
> delete the temporary lock file so the next access to your cgi script
> would believe there is still a lock .  Obviously this may be checked
> with the -M option but who has time for that ;)
>
> Well, if your machine doesn't implement either flock() or fcntl() you
> will have to find time because they are not available ;) win95 = NOPE
> Most U*IX will have flock() available...
>
> --- snip ---
>
> open(FILE, "file.txt") || die "$!";
> # I am not sure if its available for NT, have missed it out anyway
> flock(FILE, 2) if ($^O ne 'NT' && $^O ne 'MSWin32');
> # In case someone wrote to the file (appended) while waiting...
> seek(FILE, 0, 2);
>
> while (<FILE>)
> {
>         # File is read in a locked state so another implimentation
>         # of this program will have to wait until we have unlocked it
>         print $_;
> }
>
> close(FILE); # Will lift the lock
>
> --- snip ---
>
> dan wrote:
> >
> > can someone give me a quick rundown on what locking files is? thanks



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

Date: Wed, 10 Feb 1999 18:01:49 -0800
From: Gennady Stupakov <stupakov@slac.stanford.edu>
Subject: Net-SSLeay on Windows NT?
Message-Id: <36C23A0D.D5265377@slac.stanford.edu>

Was anybody able to compile, install and use Net-SSLeay on Windows NT?
All my attempts ended up in perl crashes, although I did not have any
errors or warnings
during compilation. I am using NT 4.0, VC++ 6.0, standard Perl 5.00502
from CPAN,
and Net-SSLeay 1.03.
Search of Dejanews did not give me a single positive example of
successful
compilation of the this package on Windows platform.

Any help would be appreciated.
Gennady.



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

Date: Thu, 11 Feb 1999 02:00:02 GMT
From: onewierdchild@hotmail.com
Subject: Re: Newbie from Intel Evil Empire wants to know how to get started with basic Perl program
Message-Id: <79tdit$np5$1@nnrp1.dejanews.com>

In article <XN7w2.129$7k4.266839@news2.randori.com>,
  bobtennant@loop.com (Bob Tennant) wrote:


Dear Bob,

First of all, let me be the first to welcome you to the beautifully simplistic
life of a Perl-hacker.  Although I am myself a newcomer to programming in Perl
(and indeed a newcomer to anything more than a novice's knowledge of
programming at all), I feel that I have some sort of claim to welcoming you to
our little cult, as no one else has so far.

I, too, am working on a Win95 box, although it's a tad bit old, (Intel 75 MHz
Pentium, 1.2 GB, 16 MB RAM, etc., etc.), and have recently downloaded the
32bit version of Perl. I downloaded ActivePerl, from www.activestate.com,
which seems to agree with me quite well, and is quite easily used. It may or
may not deferentiate from your interpeter, but I believe that on such a basic
subject our versions will agree.

There are two suggestions I have for you to try in running your first perl
script. Initially, if you have had any experience with using a generic
compiler (such as a C compiler), you will know that some programs can not be
run on their own (i.e., without an argument.)  I am going to make the
assumption that you have had some sort of previous run-in with a program such
as QBASIC or perhaps Visual Basic.  In these programs, you open up the
compiler and programming environment by running a .exe, from which you
compile/interprete your code.

However, Perl is a command-line program, which means it requires the input of
another file (in this case your .pl script) in order to run properly and
effieciently. If you used the Start>Run program, and just typed in its' name,
it would do nothing. Instead, you must type in the name of the program as well
as an extra input file.

 I suggest that instead of clicking on the Perl icon, you open up a MS-DOS
Prompt (this can be done quite easily by pressing Start>Run, and typing in
"Command", )  and move yourself to the /bin directory. Then, type in:

perl hello.pl

substituting hello.pl for the name of your script. If your script ends in
 .txt, I assume that it should not make much difference.

However, if you find that your interpeter does not recognize .txt files, then
you can try one of two things. I have had no problem with saving a file as .pl
in Notepad, which you might attempt to do. Or, you can go to the MS-DOS Prompt
and type in Edit, open up your .txt file and save as .pl

Sincerely Yours,
Uri M.

P.S.  In case you don't have time to wade through my long-winded message
above, which rattles on like nothing else, just remember:

Don't click the Perl icon, instead open up an MS-DOS window and move to the
directory of your Perl script, (which I will assume is named hello.pl) and
type:

Perl hello.pl

:) Be Happy :)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 11 Feb 1999 01:50:11 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: newbie perl and cgi question.....
Message-Id: <slrn7c4dqj.m9h.sholden@pgrad.cs.usyd.edu.au>

sys admin <sts-admin@dont_spam_me.com> wrote:
>>I hope not... I would hope that a sysadmin would at least know how to do
>>some simple 'printf school' debugging, and to read documentation and thus
>>not reinvent the wheel...
>
>please, if i'd wanted insulting, i'd have gone home to my children.

I just honestly believe that to call oneself a sysadmin one should really
know how to debug a little, and read documentation a lot. 

>
>>($key,$value) = ( split(/=/, $query_string[$index]) || die "died ..." );
>>
>>That has the effect of putting the split into a scalar context. So as the
>>documentation says :
>>
>>If not in list context, returns the number of fields found and splits into
>>the @_ array.
>
>ok, thats good, i've learned something.....

Which you could have learnt by reading the documentation instead of posting.
Instead of you simply doing some reading, I ended up reading your post, copying
your code to another file, modifying that code, running perl, reading the
documentation to see what was up, adding some prints to check that the my
reading of the documentation was correct, and then typing a reply to your post
and pasting some of the documentation in.

There is no reason that you could not have done the same.

>>
>>Thus $key gets assigned 2 and $value gets undef.
>>
>>A couple of print statements would have revealed this to you in a few
>seconds.
>>
>
>yes, I did exactly what you are suggesting and got the same results as shown
>above.
>I realised that $key this was the number of splits,
>however I did not know as i stated in my original post,
>why it was not behaving as I expected. You have now enlightened me....

If you had said that in the original post then I would have known the answer
in about a tenth of the time it took me. If you would mention that the work you
have done to solve the problem, then others wouldn't have to repeat it.


-- 
Sam

Even if you aren't in doubt, consider the mental welfare of the person
who has to maintain the code after you, and who will probably put parens
in the wrong place.	--Larry Wall


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

Date: Wed, 10 Feb 1999 21:51:29 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Perl 'zine
Message-Id: <36C1FF61.8CFB7AD7@patriot.net>

> I guess I'm a little bit confused by how TPJ isn't meeting your
> needs.  If it's not frequent enough (I'm working on that; it'll
> go bimonthly in 2000, and all-glossy with the next issue), then
> that's one thing that argues for electronic distribution -- but
> now you're talking about print as well?
>

First off, my original post didn't say anything about publishing
anything in hard copy.  I love TPJ, but find that I spend about 75
days waiting for the next issue.  Right now, I use Perl on Win32,
and don't find many scripts or anyone willing to discuss what they
use Perl on Win32 for...as an infosec consultant, it would help me
to better understand what NT sysadmins might use it for.

Why are you going all-glossy?  Is this something that has been asked
for?

All I'm saying is that I would like more...


> I've long been asking for a recurring page on what the Perl Monger
> groups are doing, but no one has stepped up to the plate.
>

I found this to be the case when I asked my questions on the 'groups...what do NT
sysadmins use Perl for, if they do?

I help Carolyn Meinel with the Happy Hacker Digest, and have added
a Perl Corner to it.  I've put together scripts for running MD5 checksums
on files on NT (sort of a Tripwire for NT), finger client and server, etc.
>From feedback from readers, it's really catching on...

> I always encourage people to talk about their projects, and I have
> Win32 articles in every issue.

I know.  I've read them...and I really appreciate your effort.

I had originally proposed a web-based approach...either via email or
just a web page.

> If anyone wants to help put out an electronic (and more frequent)
> version of TPJ, I'll be happy to pay you too.
>

I would be interested in assisting...it'll push me to grow in my Perls ofwisdom.

> If anyone wants to just go all-out and compete with TPJ, give
> me a call and I'll tell you how to start.  But you should make
> sure that you distinguish your magazine from TPJ somehow so that
> we don't both die.

No competition is necessary.  I was just looking for something that
was like TPJ, but maybe more frequent...

Harlan



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

Date: Thu, 11 Feb 1999 02:09:05 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Perl and Microsoft Mail
Message-Id: <slrn7c4f0a.65.alastair@calliope.demon.co.uk>

Fuzzy <fuzzy825@hotmail.com> wrote:
>Is it possible to use perl to send to Microsoft Mail (or Post Office or
>whatever they call their mail product... Exchange etc etc etc)?
>
>With attachments or am I just out in space somewhere?

Using open standard commodity protocols? Then you can probably just MIME encode
the attachment (check CPAN for MIME modules, and mail modules). 

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 11 Feb 1999 13:30:04 +1100
From: rparkes@email.com (Rohan Parkes)
Subject: Re: PERL for Personal Web Server
Message-Id: <MPG.112cebb6e9ac46e398970f@news.labyrinth.net.au>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]


Go to 
http://www.websunlimited.com/mdtips.htm

where you'll find instructions on the registry hack needed to get the PWS 
to recognise .pl files.

I've posted a question on this newsgroup regarding the syntax needed, but 
the hack seems to be correct, and I've seen it on other sites.

You can get information on setting up ActivePerl on Windows 95 at 

http://www.netcat.co.uk/rob/perl/
-- 
Rohan Parkes
Melbourne
Australia


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

Date: Wed, 10 Feb 1999 18:07:21 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problem in writing the following expression in Perl
Message-Id: <MPG.112bdb384902e290989a17@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <36C21769.6CAF8499@us.ibm.com> on Wed, 10 Feb 1999 17:34:01 -
0600, James Ludlow <ludlow@us.ibm.com> says...
> k-lo@cs.yorku.ca wrote:
 ...
> > Note: the brackets and quotes are essential.
>             ^^^^^^^^
> parenthesis

If you're going to correct someone on terminology, you might want to be 
sure to get it right yourself.  'parenthesis' is singular; plural is 
'parentheses'.

As for 'correcting' in the first place, 'brackets' (sometimes, 'round 
brackets') is perfectly normal British usage.  In fact, my Webster's-
based dictionary has this:

bracket ...
3a: one of a pair of marks [ ] ... called also 'square bracket'
 b: one of a pair of marks < > ... called also 'angle bracket'
 c: PARENTHESIS
 d: BRACE

So as far as this American dictionary is concerned, they are synonyms.

Fie, fie, fie...

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


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

Date: Thu, 11 Feb 1999 02:22:57 GMT
From: "Michael P. Reilly" <arcege@shore.net>
Subject: Re: Python vs. Perl vs. tcl ?
Message-Id: <5arw2.1019$wD5.174071@news.shore.net>

Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
: [A complimentary Cc of this posting was sent to Michael P. Reilly
: <arcege@shore.net>],
: who wrote in article <j5mw2.953$wD5.166946@news.shore.net>:
:> Python's file I/O is similar to Perl's since it uses the same
:> underlying C libraries, just the interface is different.  

: Perl does not use "underlying" C library calls.  See documentation for
: $/ to know why.

Looks like the source code for Perl 5.005_02 does use the stdio library
for <> (cf. perlio.c, sv.c, pp_hot.c op.c, toke.c).  I never said that
either used gets() (in fact neither use gets, both use getc(), at some
level).

  -Arcege



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

Date: Wed, 10 Feb 1999 19:16:14 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
Subject: The Computer Person's Prayer
Message-Id: <36C2214D.5A63991@ecpi.com>

[an anonymous computer high programmer wrote this...]

Our program, who art in Memory,
Hello be thy name.
Thy operating system come,
Thy commands be done,
At the Printer as they are on the Screen.

Give us this day our daily data,
And forgive us our I/O errors as we forgive those
Whose logic circuits are faulty.

Lead us not into Frustration,
And deliver us from Power Surges.
For thyne is the Algorithm,
The Application,
And the Solution,
Looping for ever and ever.

Return.

----------------------------------------------------
Hope you got a laugh, too.

John T. Jarrett



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

Date: Thu, 11 Feb 1999 01:29:23 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: win32::odbc error right out of the box
Message-Id: <Tnqw2.684$Uh.8112@nswpull.telstra.net>

In article <79t1ov$da8$1@nnrp1.dejanews.com>,
	foobar678@my-dejanews.com writes:
> This happened by running the script test.pl. Anyone know about this.

This happens a lot when I run the script test.pl.

> IF this is the wrong module to do this on win95, which is correct. Thanks
> gurus.
> 
> This is the error running test.pl:

This is not a perl error. It's a DSN or some ODBC error.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

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

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