[8220] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1838 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 9 13:15:23 1998

Date: Mon, 9 Feb 98 10:00:28 -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           Mon, 9 Feb 1998     Volume: 8 Number: 1838

Today's topics:
        array question <jahnel@xarch.tu-graz.ac.at>
    Re: Create new file on NT50? scott@softbase.com
        creating new file with perl <frm79@hotmail.com>
    Re: creating new file with perl <xxTony.Curtis@vcpc.univie.ac.at>
    Re: fetching text not from STDOUT (pipe) <mcreprog@ictest.delcoelect.com>
    Re: Fork is cheap and powerful <tchrist@mox.perl.com>
    Re: Good perl editor? <jgrubb@gte.net>
    Re: Good Perl editors <jgrubb@gte.net>
        Happy with Perl? (Mark Lewis)
    Re: How to get a listing of the file that is linked? <tchrist@mox.perl.com>
    Re: Is it possible to create a vector in a hash and tie <tchrist@mox.perl.com>
    Re: Is Perl 5 year 2000 compliant? (John Moreno)
    Re: MacPerl_not_even_newbie <Joergen.Lang@schwaben.de>
    Re: perl and file system <jdporter@min.net>
    Re: Perl Getpwent under Solaris 2.X problems <jdehnert@fiberlane.com>
    Re: Q: Using unpack or split to get fixed-length substr <Morten.Andersen@molbio.uu.se>
    Re: quick .signature  hack <vallon@pearl.fi.bear.com>
    Re: quick .signature  hack <rra@stanford.edu>
    Re: Reading The FAQ's etc.: a teacher's perspective... (Jeff Stampes)
    Re: Redirect problems... <tchrist@mox.perl.com>
    Re: returning the date (Ronald L. Parker)
        RFC about ``Matt's Script Archive'' <tchrist@mox.perl.com>
    Re: sorting an associative array (Mike Stok)
    Re: Syntax-coloring editor for NT (Andy Lester)
    Re: Two Perl programs -> One html output (real time) <jgrubb@gte.net>
    Re: Using flock? <tchrist@mox.perl.com>
        Win32: Ping <Olaf.Kelle@bc-verlag.de>
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl <jdporter@min.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 09 Feb 1998 18:25:47 +0100
From: Jahnel Klaus <jahnel@xarch.tu-graz.ac.at>
Subject: array question
Message-Id: <34DF3C1B.374274D1@xarch.tu-graz.ac.at>

is it possible to delete all values of an array so that the array is
empty?
Klaus



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

Date: 9 Feb 1998 15:43:02 GMT
From: scott@softbase.com
Subject: Re: Create new file on NT50?
Message-Id: <6bn866$4eg$1@mainsrv.main.nc.us>

kenny@weng.dk wrote:
> Sure.. Here is what I want to do. I want to create a new file with a simple
> free homepage system.
> The user fills in the form with a name for his html-file and then the script
> creates a html-file for
> that user:

> Now the question is: Why does the script die when it tries to create the
> html-file thatn do not exist?

Almost certainly it doesn't have permission to muck around in
the main HTML directory. Adjust the permissions to let everything
go for a few minutes and test it. If that's it, you need to change
the permissions.

> open(HTMLFILE,">$htmlfile") || die "Oppps, maybe there is more to write
> accress than I thought\n";

Any time you use die, always use $! to print some kind of error
message. It just may give you a clue!

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Mon, 09 Feb 1998 11:59:48 -0500
From: "Frank Martmnez" <frm79@hotmail.com>
Subject: creating new file with perl
Message-Id: <34DF3603.91411F64@hotmail.com>

Hello......

I've been trying to make a script that creates a new file depending on
the e-mail address that's entered.

I've been using
    system "touch emailaddress.com";

but this only works if I run the script inside the server, after I've
telneted...  It doesn't work when I run the script from the browser.

Does anyone know why?  Any response is greatly appreciated.



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

Date: 09 Feb 1998 18:42:59 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
Subject: Re: creating new file with perl
Message-Id: <7xvhuollng.fsf@beavis.vcpc.univie.ac.at>

Re: creating new file with perl, Frank <frm79@hotmail.com>
said:

Frank> creates a new file depending on the e-mail address
Frank> that's entered.

Be very very very very careful about what you accept as
email addresses.

Frank> I've been using system "touch emailaddress.com";

Yuk.

Frank> but this only works if I run the script inside the
Frank> server, after I've telneted...  It doesn't work when
Frank> I run the script from the browser.

http://www.boutell.com/

Look at the CGI FAQ.

hth
tony


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

Date: Mon, 09 Feb 1998 12:04:07 -0500
From: Matt Reprogle <mcreprog@ictest.delcoelect.com>
Subject: Re: fetching text not from STDOUT (pipe)
Message-Id: <34DF3707.69C4@ictest.delcoelect.com>

Vegard Hanssen wrote:
> 
> open(PROG, "program |") || die;
> 
> while(<PROG>) {
>         <do something with the text>
> }
> close PROG;
> 
> -------
> 
> I want to fetch the text from the program, but how do I do it when the
> program not output the text to STDOUT?
> 
> Vegard

Well, where *does* the program send the text if not stdout?

-- 
Matt Reprogle                                
IS Engineer, Delphi Delco Electronics Systems
phone:(765)451-9651    FAX:  (765)451-8230  
mcreprog@ictest.delcoelect.com


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

Date: 9 Feb 1998 16:39:46 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Fork is cheap and powerful
Message-Id: <6bnbgi$bi$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Larry D'Anna <ldanna@hotmail.com> writes:
:Tom Christiansen wrote:
:> Contrary to what prisoners of a lesser operating system will tell you,
:> fork is a elegant and inexpensive solution to many multitasking needs.
:> Be not deceived!

:Wow!
:How does the kernel do that?

It is Unix; all things are possible.  :-)

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    The only disadvantage I see is that it would force everyone to get Perl.
    Horrors.  :-)
                    --Larry Wall in  <8854@jpl-devvax.JPL.NASA.GOV>


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

Date: Mon, 09 Feb 1998 10:59:10 -0500
From: John Grubb <jgrubb@gte.net>
To: Don O'Neil <don@whtech.com>
Subject: Re: Good perl editor?
Message-Id: <6bn94g$lvh$2@gte2.gte.net>



Don O'Neil wrote:

> Does anyone know of a good windows or unix (X-Windows) based perl editor w/
> context sensitive coloring, auto indent, etc...??? I've tried Win Edit, but
> it does not have built in Perl syntax, I could add it, but that's a pain.
> I'm looking for something along the order of the editors that come w/ MS C
> and Borland C.
>
> Thanks!!

Oh! Yes, yes, yes!I found UltraEdit while browsing for shareware. It is written
AND SOLD by an individual programmer, not a huge development/sales company!!
It's VERY good and comes with libraries for several languages. I am sooo much
happier, now. It also gets rid of the annoying problem of Windows editors (Word
Pad, Note Pad) adding in end-of-line characters that are visible to UNIX (I
edit on an NT machine, then FTP to the live UNIX Web Server).
The latest version is now 5.00 (as of 11/5/97).  It is available on the
following www pages (yes, it's shareware and very useful as a freebie!!):

http://www.idmcomp.com/ and http://www.ultraedit.com/

IThis is the first editor I have ever paid for. It's $30 and worth every
penny!!!

If you register it, tell Ian where you heard about it. It helps him in
marketing.

Gunny




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

Date: Mon, 09 Feb 1998 11:11:41 -0500
From: John Grubb <jgrubb@gte.net>
Subject: Re: Good Perl editors
Message-Id: <6bn9ru$lvh$4@gte2.gte.net>

Oh! Yes, yes, yes!I found UltraEdit while browsing for shareware. It is
written
AND SOLD by an individual programmer, not a huge development/sales company!!

It's VERY good and comes with libraries for several languages. I am sooo
much
happier, now. It also gets rid of the annoying problem of Windows editors
(Word
Pad, Note Pad) adding in end-of-line characters that are visible to UNIX (I
edit on an NT machine, then FTP to the live UNIX Web Server).
The latest version is now 5.00 (as of 11/5/97).  It is available on the
following www pages (yes, it's shareware and very useful as a freebie!!):

http://www.idmcomp.com/ and http://www.ultraedit.com/

IThis is the first editor I have ever paid for. It's $30 and worth every
penny!!!

If you register it, tell Ian where you heard about it. It helps him in
marketing.

Gunny




Pedro Branco wrote:

> On Tue, 03 Feb 1998 13:28:39 -0600, Wes Gamble
> <weyus@worldnet.att.net> wrote:
>
> >Hi all,
> >
> >I am beginning to reacquaint myself with Perl and I was interested if
> >there were a preferred editor(s) that people out in Perl-land use for
> >coding.  I have downloaded a demo copy of Codewright, but it doesn't
> >seem to have built in support for Perl right off the bat (has anyone
> >created rules for Codewright to edit Perl to their satisfaction, or
> >knows how that might be done).
> >
> >I am quite adept at vi, so please none of those comments - however, I'd
> >like to have something that automatically indents, italicizes, etc. to
> >make my code easier to scan through quickly.
> >
> >Any ideas are welcomed.
> >
> >Thanks,
> >Wes Gamble
>
> I use XWPE
>
> xwpe is a X-window programming environment designed  to  use
>      on UNIX-systems. It is similar to 'Borland C++ or Turbo Pas-
>      cal' environment.
>
> xwpe has syntax highlighting, and you can easly set it up for perl.
>
> I don't remember the url, search 'xwpe' over the net and
> you'll find it.
>
> happy coding
>
>         Pedro Branco
> ____________________________________________________________________
> Pedro Feliciano Branco                        ISEL . AE -Portugal-
> Email: pedrofb@aeisel.aeisel.pt
>        f.branco@mail.telepac.pt
> http://www.aeisel.pt/~pedrofb





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

Date: 9 Feb 1998 16:45:36 -0000
From: markl@blinx.lizard.org (Mark Lewis)
Subject: Happy with Perl?
Message-Id: <6bnbrg$iec$1@blinx.lizard.org>

I am looking into the possibility of rewriting all the site-specific shell
scripts for our company in perl, but am checking to see if anybody else
has done this and wished they hadn't.

can somebody send me a list of other perl newsgroups to send this message to.

is perl stable?  would it be a good idea to risk millions of pounds on
something that is unsupported?  what do you think?

interested.
lewis




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

Date: 9 Feb 1998 16:42:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to get a listing of the file that is linked?
Message-Id: <6bnblk$bi$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, benny@iris.eee.ntu.edu.sg writes:
:How can i script perl in the way to check for the sym link then get the
:real time stamp from the file?

Meditate upon this ancient perl4 code:

#!/usr/bin/perl
# flinx -- tchrist@perl.com

$| = 1;

require 'find.pl';
@ARGV = ('.') unless @ARGV;
&find(@ARGV);

sub wanted {
    if ((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -l _) {
	&resolve;
    } 
}

sub resolve {
    local($linkname) = readlink($_) || "[readlink failed: $!]";
    print $name unless $level++;
    print " -> $linkname";

    unless (-e $linkname) 
    { 
	print " [$!] " 
    }
    elsif (-l $linkname) 
    { 
	local($cwd) = `pwd`;
	chop $cwd;
	local($dir) = $linkname;
	local($base) = $linkname;
	$dir =~ s,/[^/]*$,,;
	$base =~ s,.*/,,;
	unless (chdir $dir) {
	    warn "can't cd $dir: $!";
	    goto gone;
	} 
	local($name, $_) = ($linkname,$base);
	&resolve;
	chdir ($cwd) || die "can't return to $cwd";
    };
gone:
    print "\n" unless --$level;
} 

__END__
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    X-Windows: It was hard to write; it should be hard to use.
	--Jamie Zawinski


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

Date: 9 Feb 1998 16:35:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is it possible to create a vector in a hash and tie it to permanent storage?
Message-Id: <6bnb8d$bi$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, webmaster@profind.com writes:
:I am wondering if anyone has any experience of tying a hash, containing
:ordinary vectors to a disk drive, and/or if this is at all possible, and
:what the performance on something like that is.

But actually meant to write:

:I am wondering if anyone has any experience of tying a hash, containing
:ordinary array references to a disk file, and/or if this is at all
:possible, and what the performance on something like that is.

The key to your quandary lies in the CPAN module, MLDBM:

    % cd /usr/src/perl/pod
    % grep -l MLDBM *.pod
    perldsc.pod
    perlfaq4.pod
    perltie.pod

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


Sockets are the X windows of IO interfaces.  --Rob Pike


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

Date: Mon, 9 Feb 1998 12:03:24 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Is Perl 5 year 2000 compliant?
Message-Id: <1d46grf.1mvd6bl1cjdrk5N@roxboro0-057.dyn.interpath.net>

In comp.lang.perl.misc Tom Phoenix <rootbeer@teleport.com> wrote:

> On 9 Feb 1998, ? the platypus {aka David Formosa} wrote:
> 
> > The problem is that when multipal peaple give RTFM replies it gets some
> > what repeadative.  A suggestion if you make a RTFM type reply why don't
> > you set the message id to <rtfm.orginal-message-id> so only one reply
> > will ever occour on the same newspool. 
> 
> The people in a newsgroup about Usenet itself can give you a lot of
> reasons why that would be a Bad Thing to do. But if a thread seems too
> repetitive to you, just kill the thread in your newsreader. Hope this
> helps! 

Not to mention the truly vast number of people using newsreaders that
won't allow them to set the message id.

Also, just as importantly as any technical reason - getting a half-dozen
RTFM is probably going to be more convincing than just one.

-- 
John Moreno


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

Date: Mon, 09 Feb 1998 17:40:37 +0000
From: Joergen Lang <Joergen.Lang@schwaben.de>
Subject: Re: MacPerl_not_even_newbie
Message-Id: <34DF3F95.3F87@schwaben.de>

This address might do some good...

http://www.sasknet.com/~dalgl/MacPerlFAQ.html

Good luck, 

Joergen 
(also on a Mac - They're still alive ;-) )
-- 
____________________________________________________________

    '&`      Joergen Lang:
     #       
     #       <mailto:Joergen.Lang@schwaben.de>
    _#_      <mailto:Joergen_Lang@magicvillage.de>
   ( # )     
   / O \     HOELDERLIN EXPRESS Management:
  ( === )    <mailto:music.contact@p-net.de>
   `---'     

HOELDERLIN EXPRESS Website:
<http://www.musiccontact.com/hx>

             --- Electric Body Folk ---

_____________________________________________________________


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

Date: Mon, 09 Feb 1998 11:00:47 -0500
From: John Porter <jdporter@min.net>
Subject: Re: perl and file system
Message-Id: <34DF282F.142@min.net>

Tom Christiansen wrote:
> 
>     $ mount | grep fs | perl -pe 's/.+type\s+(\S+).*/$1/'



Well, not on Solaris 2.  You need mount -v on that.

And on BSD/OS (3.1), I couldn't get mount to give this info at all.

Also, mount may be in different directories, typically /usr/sbin/.

John Porter


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

Date: Mon, 09 Feb 1998 09:32:15 -0800
From: James Dehnert <jdehnert@fiberlane.com>
Subject: Re: Perl Getpwent under Solaris 2.X problems
Message-Id: <34DF3D9F.1B39EF22@fiberlane.com>

Remove xx to reply wrote:
> 
> Re: Perl Getpwent under Solaris 2.X problems, James
> <jdehnert@fiberlane.com> said:
> 
> James> Im running Perl 5.003 under Sun Solaris 2.5.2 & 2.6.
> James> I'm not able to get getpwent to read its info from
> James> the NIS+ tables.  It will get info from the system
> James> /etc/passwd file, but this isn't what I need!
> 
> James>   getgrent ( on the other hand ) seems to work
> James> fine...
> 
> What does /etc/nsswitch.conf say?
> 
> hth,
> tony

/etc/nsswitch.conf says

passwd:     nisplus files
group:      nisplus files

but I have set it up as..

passwd:     nisplus
group:      nisplus

and 

files:	    files nisplus
group:      files nisplus 

for testing, all with the same results ( i.e.  only getting
info on the local passwd file )

  Zeke
-- 
+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
* mailto:jdehnert@fiberlane.com  http://www.fiberlane.com *
+ James "Zeke" Dehnert      Fiberlane Communications Inc. +
* Network Administrator      1318 Redwood Way, Suite #200 *
+ Eschew Obfuscation   707.793.9055   Petaluma,  CA 94954 +
*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*
+   Opinions expressed are not those of Fiberlane Inc.    +
*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*


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

Date: 09 Feb 1998 16:55:36 +0100
From: Morten Stig Andersen <Morten.Andersen@molbio.uu.se>
Subject: Re: Q: Using unpack or split to get fixed-length substrings?
Message-Id: <x5k9b4ixhj.fsf@beagle.bmc.uu.se>

Tom Phoenix <rootbeer@teleport.com> kindly suggested this solution,
which works:

    my $string = "aaabbbcccd";
    my @array = ($string =~ /(.{1,3})/g);

But I'd like to know the most efficient way to do this (i.e. avoid
regular expressions), because I also want to use it on megabyte-sized
strings. Isn't unpack the answer, then?


-- 
=-=-=-=-=-=-=-=-=-=-=-=  \,`/ /   =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Morten Stig Andersen   _)..  `_    Department of Molecular Biology
                       ( __  -\     BMC, University of Uppsala
 tel:  +46 18 4714214      '`.      Box 590, 751 24 UPPSALA, Sweden
 fax:  +46 18  557723     ( \>_-_,  --------------------------------
 mail: moan@biobase.dk    _||_ ~-/  http://evolution.bmc.uu.se/~moan


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

Date: 09 Feb 1998 11:39:15 -0500
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: quick .signature  hack
Message-Id: <x6eoh0gn364.fsf@pearl.fi.bear.com>

Sorry I'm late.

Philip Mikal <philipm@nafohq.hp.com> writes:

> ##################################################
[...]

$ cat rand-sig
#!/usr/local/bin/perl5 -w

open(SIGS, ".sigs") || die "open .sigs: $!";
local @sigs = split /EndOfSig\n/, join "", <SIGS>;
#                    ^^^^^^^^^ Just be careful about special characters.
close(SIGS) || die "close .sigs: $!";

srand;
local $num = int(rand(@sigs));

open(SIG, "> .sig") || die "open .sig: $!";
print SIG $sigs[$num];
close(SIG) || die "close .sig: $!";

$ cat .sigs
This is signature 1.
EndOfSig
-Joe
joe@work.com
EndOfSig
-Joseph
joe@work.com

That could be 5 lines if you invoked it with rand-sig > .sig.


> Mark Crane wrote:
> 
> > This is a pathetic attempt to get some perl wizard to write a
> > simple script for me.  Please stop reading now if you find this
> > annoying, etc.
> >
> > <plead>
> >
> > I am trying to figure out how to do the following:
> >
> > In order to use multiple random sigs on Pine, I am trying to
> > cobble a
> > script together that will
> >
> > 1. look at a file of quotes or sigs delimited by  multiple
> > returns or some pre-chosen character string, like "$$$$"
> >
> > 2. select a quote at random.
> >
> > 3. write it to the file ".sig"
> >
> > That's it.  I would have it run every time I went into pine.  Is
> > this doable in 4 lines or less? (not that it matters--I'm trying
> > to goad someone into writing it for me because I am
> > lazy/busy/newbie)
> >
> > </plead>
> >
> > thanks,
> >
> > Mark Crane
> 
> 
> 

-- 
-Justin
vallon@bear.com


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

Date: 09 Feb 1998 09:16:27 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: quick .signature  hack
Message-Id: <m3en1chf6c.fsf@windlord.Stanford.EDU>

Mark Crane <mecran01@homer.louisville.edu> writes:

> I am trying to figure out how to do the following:

> In order to use multiple random sigs on Pine, I am trying to cobble a
> script together that will

> 1. look at a file of quotes or sigs delimited by multiple returns or
> some pre-chosen character string, like "$$$$"

> 2. select a quote at random.

> 3. write it to the file ".sig"

Other people have given you Perl solutions to this problem; in the "use
the other tools too" department, here's a recommendation for a very good
non-Perl solution that may involve a good deal less thinking.

If you're only interested in Perl, stop reading here.  :)

There is a program which used to come standard with most Unix OSes and
which is still fairly common called "fortune," whose entire raison d'jtre
was to select a random quote from a database of quotes.  When I set up my
random signatures in Gnus, I just used it.

The way fortune works is that you create a file containing all of the
quotes you want it to select from, separated by a single % on a line by
itself.  Then you run strfile on that file, and it generates the index
file that fortune can use.  Whenever you want one of them, you can then
run fortune and give it that data file as its library, and it will handle
the randomization (plus you get all of fortune's other features, such as
randomization between multiple libraries, selection of short vs. long
entries, and so forth).

If you want to try this approach, see the fortune(6) and strfile(8) man
pages, if they exist on your system.  (If they don't, you may not have
fortune available to you.)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 9 Feb 1998 15:49:21 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Reading The FAQ's etc.: a teacher's perspective...
Message-Id: <6bn8i1$am7$1@neocad.com>

Lynchqvctc (lynchqvctc@aol.com) wrote:
: So when I hear folks say..."Didn't you read the manpages?" or "Hey..that's a
: CGI question, not a perl question"... when someone posts a request for help, I
: am torn between agreeing with the response (the responder must know what he/she
: is talking about... they are the "experts") and saying..."yes... but YOU know
: that... maybe the questioner isn't even at the point to know it." 

So they get told.  There's a big difference between:

'That's in the FAQ'
       and
'See: <insert link or reference to answer in FAQ>. The FAQ is
 available on CPAN or as part of the standard distribution in
 current versions of perl.'

We can always use more of the latter, and can do without the former.
It's exactly the way I am with people I'm training at work.  When 
they come with questions, I tell them where I would find the answer.
Most of the time, they say "Well I'll go look myself then" and help
themselves while learning how to use a resource. It makes teaching 
perl to them very easy, due to the wealth of free resources available. 


--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: 9 Feb 1998 17:26:15 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Redirect problems...
Message-Id: <6bne7n$3i0$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, rott@cs.utexas.edu (Mike Rheinheimer) writes:
:This is a curious problem:
:
:I have a script that emails several users in a data file specified by the
:html file that calls it.  Also, the redirect option is specified by the
:html file.  The problem is that whenever email is sent, the redirect option
:does not work (Server 500 error).  If I eliminate the call to the send_mail
:subroutine the redirect option does work.  Below is a snippet of the code.
:Any help would be appreciated.

I looked at your code.  It violates many of the more 
important tenets of problem-solving checklist at 
http://language.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html

I suggest you consult that document.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

pos += screamnext[pos]  /* does this goof up anywhere? */
    --Larry Wall, from util.c in the v5.0 perl distribution


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

Date: Mon, 09 Feb 1998 16:59:16 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: returning the date
Message-Id: <34df356f.8488305@10.0.2.33>

On 9 Feb 1998 14:50:31 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>I don't think you should use MM/DD/YYYY either.  Is that really MM/DD
>or DD/MM?  ISO says DD/MM/YYYY, but as you see, that has the same problem.

My understanding was that ISO is now squarely behind YYYY-MM-DD (or
YYYYMMDD for those who need to save a couple of bytes), which has the
advantages of not looking like anything we're used to (less chance for
error) and of being sortable with a simple string comparison.



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

Date: 9 Feb 1998 17:16:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: RFC about ``Matt's Script Archive''
Message-Id: <6bndl9$3i0$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author et al. via email]

In comp.lang.perl.misc, mikael@techtalk.se (Mikael Skogstrom) writes:
:I'm trying to use FormMail, from Matt's Script Archive...

I have heard no end of criticisms about that set of programs.  I once
looked at them myself and found them to be full of programming errors
and undersights.  Could an expert perl programmer who has more recently
examined them please comment on their robustness and style?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    "Just because something is obviously happening doesn't mean something obvious
    is happening." --Larry Wall


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

Date: 9 Feb 1998 10:34:53 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: sorting an associative array
Message-Id: <6bn7mt$16p$1@stok.co.uk>

In article <6bmomq$t02$1@news2.xs4all.nl>,
Hans Van Lint <hvanlint@lodestar.be> wrote:
>How can I sort an associative array ascending by keys, and still use it as
>an associative array (sorted on key).

If you have a regular hash in memory then you can't really sort it, one
thing you can do is sort a list of its keys and maintain them in parallel 
with the hash. 

If you want more information the see the FAQ, section 4 contains the
question How do I sort an array by (anything)?, references
http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html and has the question How
do I sort a hash (optionally by value instead of key)?  It also contains
this snippet: 

       How can I always keep my hash sorted?

       You can look into using the DB_File module and tie() using
       the $DB_BTREE hash bindings as documented in the section
       on In Memory Databases in the DB_File manpage.

The FAQ is distributed with recent perls (perldoc perlfaq should get it
for you) and can be found on http://www.perl.com and at a CPAN
(comprehensive perl archive network) site near you.  The master CPAN site
is at ftp.funet.fi under /pub/languages/perl/CPAN and contains a list of
mirror sites.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 9 Feb 1998 17:37:02 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: Syntax-coloring editor for NT
Message-Id: <6bneru$22t$1@usenet87.supernews.com>

: Why pay $100 for some silly little MultiEdit when
: GNU Emacs is free and _much_ beter?

Because I hate Emacs.

Why give someone shit for espousing an opinion?  Go find someone who
cares.

xoxo,
Andy

--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Mon, 09 Feb 1998 11:07:03 -0500
From: John Grubb <jgrubb@gte.net>
To: Ben Holness <bholness@nortel.ca>
Subject: Re: Two Perl programs -> One html output (real time)
Message-Id: <6bn9j9$lvh$3@gte2.gte.net>

Simplest way is to delete the executable line #!usr/bin/perl and the <HTML>
and <HEADER> tags and the header text from p2.pl and copy all of it's text
into p1.pl, below the <HR>. This will create one seamless page, with a break
between the two sections.

If you are running two seperate forms, just close the form on the first
section (p1.pl) with a </FORM> tag and start a new form on the second
section ( originally p2.pl) with a <FORM> tag and close it at the bottom
with a </FORM> tag.

Be careful of multiple <HTML>, <HEAD>, <BODY> and <FORM> tags as well as
their closing tags.

Gunny

Ben Holness wrote:

> Hi all,
>
> Does anyone know how I can merge two perl scripts to one html output:
>
> I have two perl scripts, p1.pl and p2.pl, each which contain print
> statements that print to the web page in real time.
>
> Each of them can be run separately, by clicking on the /cgi-bin/p1.pl or
> /cgi-bin/p2.pl links, but I would like the following to happen:
>
> When the user clicks on /cgi-bin/p1.pl, the output of p1.pl is displayed
> as normal on the screen, followed by an <hr> break (which I can add at
> the end of the p1.pl file), followed by the output of p2.pl
>
> I have tried running p2.pl from p1.pl, using the system command, but
> this does not seem to work.
>
> Any ideas?
>
> Cheers,
>
> Ben
> --
>   _____________________________________
>  /                                     \
> |        *-=Ben Holness=-*              |
> |                                       |
> |    Dept. 7e24 % bholness@nortel.ca    |
> |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
> | ESN: 590-4957 % PSTN: (01628) 434957  |
> |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|





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

Date: 9 Feb 1998 17:31:45 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Using flock?
Message-Id: <6bnei1$3i0$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    mikael@techtalk.se (Mikael Skogstrom) writes:
:I know you're supposed to use FLOCK to lock a file from beeing used by more
:than one script at a time. But I really haven't understood why; shouldn't
:the OS take care of it, so that no more than one program can write at a
:time? (Reading is a bit different, I guess.)

Gods, no!  That's none of the operating system's business.  It's an
application-level issue.  Otherwise, you'd have hung processes and end
up with asphyxiating lockstep or deadlock on high-throughput databases,
amongst other interesting things.  Remember what Doug Gwyn said:

    "UNIX was not designed to stop you from doing stupid things, 
    because that would also stop you from doing clever things." 

In short, flock is solely and uniquely for blocking other flocking.
It has no effect upon I/O whatsoever.  This is the more flexible
and more powerful way of doing things.  If you don't like it, you
can go back to single-tasking systems. 

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


sum to check equivalent files should use sum -a. --Andrew Hume


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

Date: Mon, 09 Feb 1998 18:42:44 +0100
From: "Dr.-Ing. Olaf H. Kelle" <Olaf.Kelle@bc-verlag.de>
Subject: Win32: Ping
Message-Id: <34DF4014.F4AB4E17@bc-verlag.de>

Hi,

has anyone solved the problem - or has an idea - for the Net::Ping under
Win32 (ActiveState port) ?

Thank you very much.

Olaf






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

Date: Mon, 09 Feb 1998 11:06:22 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34DF297E.2289@min.net>

Tom Christiansen wrote:
> 
> If your birthday is
> "2/2/05", are you 106 years old in 2006, or just one year old?

Well, you sure won't be 106. Maybe 101, or 201...

John Porter


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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