[11679] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5279 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 1 17:04:40 1999

Date: Thu, 1 Apr 99 14: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           Thu, 1 Apr 1999     Volume: 8 Number: 5279

Today's topics:
    Re: <STDIN> <cassell@mail.cor.epa.gov>
        assigning variables to results of grep? <mvp@backrub.cs.itc.hp.com>
    Re: assigning variables to results of grep? <paul.cameron@sun.com>
        Environment control <reatmon@ti.com>
    Re: Here docs, single quotes, and backslashes (I R A Aggie)
    Re: my random doesn't return number!! (Steve Linberg)
        need help on object reference <fangyuan@cse.buffalo.edu>
    Re: Perl and shell commands ??? (Steve Linberg)
    Re: perl and y2k (was Re: The millennium cometh -- even <cassell@mail.cor.epa.gov>
    Re: Perl efficiency vs. C++. (Ilya Zakharevich)
    Re: Perl efficiency vs. C++. <APTavistock@lbl.gov>
        Perl under AIX 4.2 and mod_perl segfaults <khelben_blackstaff@my-dejanews.com>
    Re: Perlshop <cassell@mail.cor.epa.gov>
    Re: Problem... <debot@xs4all.nl>
    Re: problems with 'require'. <APTavistock@lbl.gov>
    Re: quick question... <jearanai@my-dejanews.com>
    Re: Retrieving  info after POSTing from a perl script <gregm@well.com>
    Re: Retrieving  info after POSTing from a perl script ran@netgate.net
    Re: Running a perl script as a daemon.... <cassell@mail.cor.epa.gov>
        Stupid questions (Josh ''RudeSka'' Rush)
    Re: Stupid questions (Steve Linberg)
    Re: Text::Soundex for languages other than English? <cassell@mail.cor.epa.gov>
    Re: trying to build C like structure in perl <sfaust@isi-mtl.com>
    Re: two questions need help fanxin@my-dejanews.com
        Upload from CGI (The Jazenator)
    Re: Upload from CGI <camerond@mail.uca.edu>
    Re: URGENT (Clinton Pierce)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 01 Apr 1999 11:23:41 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: <STDIN>
Message-Id: <3703C7BD.17620A9B@mail.cor.epa.gov>

Scratchie wrote:
> Elliot Slater <eslater@frinc.com> wrote:
> : Am I able to assign a value to <STDIN> as I would any other variable?
> 
> No, and what are you trying to accomplish anyway?  There's probably some
> simple way to do what you want to do, but from this question we have no
> way of knowing. Post some code or give us a description of what you're
> trying to accomplish and maybe we can help (or at least point you to the
> right part of the FAQ! :)

You mean that doesn't count as help?  :-)

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 01 Apr 1999 12:59:18 -0700
From: Marshall V Pierce <mvp@backrub.cs.itc.hp.com>
Subject: assigning variables to results of grep?
Message-Id: <3703D016.A149F779@backrub.cs.itc.hp.com>

I was shocked to find that the following does NOT work:

($x,$y,$UserID) = 
split(':',`grep "49[0-0][0-9][0-9]" /etc/passwd | awk '{ FS=":";print $3
}' | sort | tail -1`);

Nor does:
$UserID = `grep "49[0-0][0-9][0-9]" /etc/passwd | awk '{ FS=":";print $3
}' | sort | tail -1`

Dunh?  The awk is ignored and the sort operates on the username and I
get the wrong userid.

Short of reading in the entire passwd file (very large), how should this
be coded? I just need to find the last id used in the range 49000-49099.

TIA

-- 
Marshall V Pierce            /_ __    Hewlett-Packard Company
marshall_pierce@hp.com      / //_/    Americas IT
USA (719) 590-3461            /


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

Date: Thu, 01 Apr 1999 21:29:01 +0000
From: Paul Cameron <paul.cameron@sun.com>
To: Marshall V Pierce <mvp@backrub.cs.itc.hp.com>
Subject: Re: assigning variables to results of grep?
Message-Id: <3703E51D.E2B5F900@sun.com>

Marshall V Pierce wrote:

> I was shocked to find that the following does NOT work:

Oh no, why do I feel personally responsible for this ??

(hang on, I'm not, why should I care how you feel)

> ($x,$y,$UserID) =
> split(':',`grep "49[0-0][0-9][0-9]" /etc/passwd | awk '{ FS=":";print $3
> }' | sort | tail -1`);

You're programming in Perl, right ? I mean, if you're using backquotes
to get at grep, awk, sort and tail where there is no real performance
increase, why did you bother writing it in Perl ?

Oh, and you'll want to escape your $3, since that will most likely be
interpolated in your backticks.

>
> Nor does:
> $UserID = `grep "49[0-0][0-9][0-9]" /etc/passwd | awk '{ FS=":";print $3
> }' | sort | tail -1`

I should probably ask, what is the point of [0-0] ?

Perhaps you might try:
open PASSWD, "</etc/passwd" or die "Error opening /etc/passwd: $!";
$rec = (sort map (split /:/, $_)[2], grep /490\d\d/, <PASSWD>)[-1];
close PASSWD;

What, did that confused you ?? Visit:
    ftp://ftp.archive.de.uu.net/pub/CPAN/doc/FMTEYEWTK/sort.html

(don't whinge, just do it)

But since you don't want to have the file read in at once, perhaps you
may want to while <PASSWD> over each record.

> Dunh?  The awk is ignored and the sort operates on the username and I
> get the wrong userid.
>
> Short of reading in the entire passwd file (very large), how should this
> be coded? I just need to find the last id used in the range 49000-49099.

Once again, are you sure you posted to the right NG ?

Paul.

(yes, I am aware the sort is not numeric, but it does not matter here)



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

Date: Thu, 01 Apr 1999 14:52:20 -0600
From: Ryan Eatmon <reatmon@ti.com>
Subject: Environment control
Message-Id: <3703DC84.161AEA4B@ti.com>


Is there a way to set environment variables in a Perl script and have
them remain after the script finishes?  Sort of like sourcing a .cshrc
file?  I have a feeling the answer is no, but I'd like to dream a
little.

-- 

Ryan Eatmon                reatmon@ti.com
-----------------------------------------
Mixed Signal Product Development EDA Team


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

Date: 1 Apr 1999 19:05:35 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Here docs, single quotes, and backslashes
Message-Id: <slrn7g7h0n.5i0.fl_aggie@stat.fsu.edu>

On Thu, 01 Apr 1999 17:55:13 GMT, Sean McAfee
<mcafee@waits.facilities.med.umich.edu> wrote:

+ print <<'EOT';
+ \\\\
+ EOT
+ print '\\\\';

+ This prints:

+ \\\\
+ \\

+ Bug or feature?

I don't think its a bug in the here-doc -- I would expect that
result. However, that's not what I would have expected from a
single-quoted sting. I didn't think _any_ interpolation occured in
those.

Apparently that's not completely true. But...from perlop:

         Customary  Generic        Meaning        Interpolates
             ''       q{}          Literal             no

Now, I'm waay confused.

James


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

Date: Thu, 01 Apr 1999 15:28:32 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: my random doesn't return number!!
Message-Id: <linberg-0104991528320001@ltl1.literacy.upenn.edu>

In article <37028C89.7566@protix.com>, David Delikat <ddelikat@protix.com>
wrote:

> neither will '@keys'  in a scalar context it evaluates to 
> <trumpet fanfare> '$#keys'

Did you try it?

my @foo = (1, 2, 3, 4, 5);
for (1..50) {
 print $foo[rand $#foo];
}
print "\n";
for (1..50) {
 print $foo[rand scalar @foo];
}
__END__

21422143413224422441141421222244443313214333321343
34322421434554154534511145141123411322244123333113

Simple enough to test it out first...

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: Thu, 1 Apr 1999 13:45:05 -0500
From: Fang Yuan <fangyuan@cse.buffalo.edu>
Subject: need help on object reference
Message-Id: <Pine.GSO.3.96.990401133542.18082A-100000@pegasus.cse.Buffalo.EDU>

Hi,
I have a module called Tree.
It works well,when I make an instance of the object (e.g,$tree), and
use it to call methods defined in the Model Tree.
But it can't work, when first I put the instance ($tree) into an
associate array,and then take it out sometime later to call the methods
defined in the Model.below is How I define the "new" method:
ub new {
    
    my $self = shift;
    my $package = ref $self || $self;
    my %ARGV = @_;
 
    my $B1 = $ARGV{B1};
    my $B2 = $ARGV{B2};
    my $Root = exists($ARGV{Root}) ? $ARGV{Root} :
BPlusTree::Node->emptynode;
    bless { B1 => $B1,B2 => $B2, Root => $Root } , $package;
}

What should I do?

Thanks for your reply!

======================================================
Fang Yuan                     fangyuan@cse.buffalo.edu



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

Date: Thu, 01 Apr 1999 15:44:39 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Perl and shell commands ???
Message-Id: <linberg-0104991544400001@ltl1.literacy.upenn.edu>

In article <7e0dam$i6v$1@nnrp1.dejanews.com>, sriram@eng.ua.edu wrote:

> I am trying to output bold charecters

Sounds like a shell question.  Perl doesn't know anything about bold characters.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: Thu, 01 Apr 1999 11:50:30 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: perl and y2k (was Re: The millennium cometh -- eventually)
Message-Id: <3703CE06.A664ACE4@mail.cor.epa.gov>

Russell Schulz wrote:
> "David L. Cassell" <cassell@mail.cor.epa.gov> writes:
> >> again:  this is why I disagree with the FAQ.  I have never seen a
> >> pencil that would surprise a user (who, shockingly, hadn't memorized
> >> its manual) by writing 100 when referring to 2000.
> >
> > Oh no!  He's right!  All programming languages are Y2K noncompliant,
> > since someone somewhere can misuse them!
> 
> I see a big difference between `can misuse' and `will misuse, if using the
> natural way provided'.
> 
> Does your response mean:
> 
>   a. You don't understand this difference?
>   b. You don't think the difference is real?
>   c. You think the difference won't affect real code?
>   d. You just wanted to make a Unabomber post?
>   e. Other...?

[e]  I was trying to lighten up this thread a little.

I agree with you that C makes it hard to do this right, and that languages
based on this can have problems.  I've seen errors in Perl code introducing
this very problem - in Perl code written this year and posted to this
newsgroup.  So who can know how much bad code is out there, waiting to
do something nasty/embarrassing in 9 months?

I guess it's a good thing the Perl FAQ recommends not writing that code
to run your nuclear power plant in Perl.  Does Homer Simpson know about
this too?  :-)

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 1 Apr 1999 19:03:55 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl efficiency vs. C++.
Message-Id: <7e0fur$nei$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Jari Aalto+mail.perl
<jari.aalto@poboxes.com>],
who wrote in article <ptraewscvko.fsf@blue.sea.net>:
> All you can do with C++ you can do with perl.
> The difference is that the code needed in Perl is 1/20th of the C++
> equivaent. Development time is 1/20th and maintenance time is
> 1/10th.
> 
> In addition, you get platform independency for free.
> 
> Yes, C++ runs faster, but in the long run other measures becomes more
> important.

In some cases 200 times (*) difference in speed *may* be important.
In some cases cyclical structures will get into your way.  Otherwise
the advice is a sound one.

(*) Such a difference is possible if it is hard to translate the
problem to use higher-level Perl primitive, as with arithmetic
calculations.

Ilya


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

Date: Thu, 01 Apr 1999 12:39:24 -0800
From: Aaron Tavistock <APTavistock@lbl.gov>
Subject: Re: Perl efficiency vs. C++.
Message-Id: <3703D97C.2A5928EF@lbl.gov>

This really depends on what you need.  

Development time, maintainence time, and portablity of perl are great
benefits, but perl is going to be significantly slower in processing
than C.  However for most tasks the speed is not noticable by the
end-user.

In my opinion the benefits of perl make it worth using most of the time
for almost everything.  The only time I pull out C these days is when
I'm going to be doing extensive algorithms that don't require much user
interaction, and even then I usually use perl as a front-end and/or
glue.  

I do some Java Servlet programming, which has major benefits over perl
for large, scalable, enterprise level web applications.  But again, I
use perl for most of my CGI stuff because of the development and
maintainence time.

AT


Heng Sun Chao wrote:
> 
> Greetings,
> 
>     I'm a newbie to Perl.  I am trying to determine if it worth
> implementing some software in PERL or to maintain C++.
>     My main concern is speed and maintenance.  I was wondering if there
> are any studies or benchmarks comparing the speeds of the two languages.
> 
> Thanx.


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

Date: Thu, 01 Apr 1999 20:29:09 GMT
From: Khelben Blackstaff <khelben_blackstaff@my-dejanews.com>
Subject: Perl under AIX 4.2 and mod_perl segfaults
Message-Id: <7e0ku9$pfd$1@nnrp1.dejanews.com>

Hi!

I'm using:
    IBM F50-RS/6000 PPC
    AIX 4.2.1 with Y2k-fixes
    gcc 2.8.1
    perl 5.005_02
    mod_perl 1.17
    mod_ssl 2.2.7
    mod_php 3.0.6
    apache 1.3.6

I compiled perl with all modules as shared and it segfaults
as i "perl Makefile.PL" of mod_perl.

Any hints ?

*--------------------------------------------------------------*
|  Khelben Blackstaff is out there ! !                         |
|    apache,perl,php,linux,startrek,b5,eastern,stories         |
*--------------------------------------------------------------*

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


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

Date: Thu, 01 Apr 1999 11:22:10 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Perlshop
Message-Id: <3703C762.82406413@mail.cor.epa.gov>

Nico Oosterwijk wrote:
> 
> OK, I'm calling the script file with
> 
> <form METHOD=POST ACTION="http://server/cgi-sys/perlshop.cgi">
> <input type=SUBMIT NAME=ACTION value="ENTER SHOP">
> <input TYPE=HIDDEN NAME=thispage VALUE="page1.html">
> <input TYPE=HIDDEN NAME=ORDER_ID VALUE="!ORDERID!">
> 
> In the perlshop.cgi file there is a line that I don't understand:
> if (lc $unique_id eq '!ORDERID!') || ( $unique_id !~ /\d{$id_length}?/ ))
>     {&Transmission_error(3);}
> 
> I'd always receive the subroutine Transmission_error(3) all the time......

Well I don't understand this line either.  At a minimum, it is
missing a '(' right after the 'if'.  Did you cut-and-paste this,
or did you type it?
 
> What does the line means:, I think it first checks if !ORDERID! is equal to
> the variable $unique_id, but then?

Almost.  It checks if lc($unique_id) matches it.  unary operators
have precedence over 'eq'.  And since lc() changes to lower case,
lc($unique_id) cannot ever match !ORDERID! .  Do you need to drop
that 'lc'?  Or do you need to lower-case '!orderid!' instead to do
the match?

> What is || ($unique_id !~/\d{$id_length}?/)) ????

|| is 'or' (the not-ultra-low-precedence version)
!~ is the negative of the pattern-binding operator - it's
   checking whether $unique_id *fails* to match what's in //
\d means a digit
\d{n}? seems to match if there are at most n digits, but
   there are better ways to make such a match in modern Perls

So.. how is $id_length determined?
 
> If it is a problem with the variables, I'll check with arpanet, but it's a
> free version and support is not guaranteed....

Maybe you might want to think about what you want to catch that
should be sent to the &Transmission_error subroutine ?

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 01 Apr 1999 22:33:13 +0200
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: Problem...
Message-Id: <3703D809.6FC91857@xs4all.nl>

It was realy the idea to prevent the loops, but I think it can only be done as
you say.

"Charles F. Radley" wrote:

> $counter=0;
> $string = <>;
> @words = split / /,$string;
> foreach $word (@words)
> {
> $counter++ if ($word eq "Perl");
> }
> print "$string" if ($counter == 2);
>
> You could also do it in fewer lines with an appropriate regular expression.
>
> Frank de Bot <debot@xs4all.nl> wrote in article
> <36FFFF46.4EEAACA8@xs4all.nl>...
> > I've started to build my own searchengine.
> > I have this Keyword: "Perl"
> > I have this string to look for matches:  "Free Perl scripts, Get your
> > Perl Scripts here" .
> >
> > Perl exist 2 times in that string. How can I make the script that it
> > count the number of "Perl" (in this case). This should be 2. How can I
> > do that automatic?
> > Thanks,
> >
> >
> > --
> > My Email  : debot@xs4all.nl
> > Homepages : - http://www.debot.nl/ppi/
> >             - More coming up....
> >
> >
> >

--
My Email  : debot@xs4all.nl
Homepages : - http://www.debot.nl/ppi/
            - http://www.searchy.net/




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

Date: Thu, 01 Apr 1999 12:24:49 -0800
From: Aaron Tavistock <APTavistock@lbl.gov>
Subject: Re: problems with 'require'.
Message-Id: <3703D611.B9D3A819@lbl.gov>

Unfortunately 'do' displays the same problems as 'require' in this
situation.  They both appear to be unable to access the lexical
namespace of calling routine.  The three lines of code that are listed
are able to access this space.

AT

Tramm Hudson wrote:
> 
> Aaron Tavistock  <APTavistock@lbl.gov> wrote:
> > I improperly assumed that require was essentially a stream based eval.
> > :)  Which is how I came to a brute force solution that works as well.
> >
> > open (CONF, './test.conf);
> > eval (join ("\n", <CONF>));
> > close (CONF);
> 
> Wow.  While, yes that does work, you should check out perldoc -f do
> which tells you that
> 
>         do 'test.conf'
> 
> is equivilant to
> 
>         scalar eval `cat test.conf`
> 
> Tramm
> --
>   o   hudson@swcp.com                 tbhudso@cs.sandia.gov   O___|
>  /|\  http://www.swcp.com/~hudson/          H 505.266.59.96   /\  \_
>  <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.284.24.32   \ \/\_\
>   0                                                            U \_  |


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

Date: Thu, 01 Apr 1999 18:54:32 GMT
From: apple <jearanai@my-dejanews.com>
Subject: Re: quick question...
Message-Id: <7e0fd3$kak$1@nnrp1.dejanews.com>

In article <37037504.17425DB8@datenrevision.de>,
  Philip Newton <Philip.Newton@datenrevision.de> wrote:
> apple wrote:
> >
> > How can I create a HTML file by using Perl in case of I don't want to
> > use CGI?
>
> You asked that question already. Don't expect answers in 5 minutes.
> Usenet rewards patience. (And comp.lang.perl.misc rewards reading the
> docs.)
>
> Cheers,
> Philip
>

Sorry for making you read twice. I am new in this website and new for a
computer user so I am very appreciated your suggestion. For my reason, I
don't want to bother you with my second message but I did misspelled in my
first message like this "usong". Thus, I rephrased the second one just for
make sure that everyone can know it. It didn't mean that I want to trick you.

Thank you,
--apple




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


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

Date: Thu, 01 Apr 1999 11:18:42 -0800
From: Greg McCann <gregm@well.com>
To: Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com>
Subject: Re: Retrieving  info after POSTing from a perl script
Message-Id: <3703C692.8C4686BF@well.com>

I don't understand the question.  Are you local to this server and trying to
test the cgi script from your command prompt?  Are you remote and looking
for a way to post data to the script without going through the existing web
page?

Greg

Ketan Patel wrote:

> I've been trying to figure out how to POST to a cgi script via perl, but
> I can't seem to figure it out... I followed the example in the docs but
> it doesn't seem to work for POST (I can get it to work for GET)...
>
> I'd like to post the data the form at this URL is asking for directly to
> the CGI and retrieve the course listing that is created:
>
> https://www.bu.edu/link/bin/uiscgi_studentlink?applpath=univschs.pl
>
> If you'd like to test it, try FALL 99, CAS, CS, 113, and A2 for your
> values.  I can see that the form is being POSTed to
> "https://www.bu.edu/link/bin/uiscgi_studentlink", but how do I define
> the values for the form, etc?
>
> Thanks!

 ======================
Gregory McCann
http://www.calypteanna.com

"Be kind, for everyone you meet is fighting a great battle."  Saint Philo of
Alexandria




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

Date: Thu, 01 Apr 1999 20:14:06 GMT
From: ran@netgate.net
Subject: Re: Retrieving  info after POSTing from a perl script
Message-Id: <922997646.066.93@news.remarQ.com>

In <3703B64A.49093000@BLAHNOSPAMBLAHxwebdesign.com>, Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com> writes:
>I've been trying to figure out how to POST to a cgi script via perl, but
>I can't seem to figure it out... I followed the example in the docs but
>it doesn't seem to work for POST (I can get it to work for GET)...

I just finished doing something like this for a different webpage.  The 
thing that tripped me up was that the POST kept coming back with an 
error that I didn't understand (being a newbie to HTTP).  Here's a 
snippet of the code I wound up with:

  my $next_url = "";
  my $ua = LWP::UserAgent->new;
  my $response = $ua->request(POST "http://url_snipped",
         [
         query => "$srcharg",
         method => "bool",
         jtype => "SWE",
         daysback => $days_back,
         num_per_page => "50",
         num_to_retrieve => "2000",
         acode => ["408", "650", "831"]
         ]);

       if ($response->code == 302) {  # expected on first request
           $next_url = $response->header("Location");
           }

       while ($next_url) {
           $response = $ua->request(GET $next_url);
           # Process page
           # set "$next_url" to a URL if there are more pages, else ""
           }

Noteworthy bits:

This query can return multiple pages of info that are hyperlinked 
together (hence the "while" loop").

"acode" is a multiple-selection listbox.  It took me a while to figure 
out that this is the way those are encoded in the request.  There's 
actually an example in the docs of using an array as a value for the 
hash,  iirc,  but it didn't say why the array was being used,  so I 
wound up guessing that this was the purpose.

The response code of 302 ("Temporarily moved") is the *normal* result 
for this particular system,  and might be for such systems in general. 
Not knowing any better,  I had been expecting an automagical redirect to
the first results page.  There's a good chance that this is what's 
tripping you up right now.

Ran




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

Date: Thu, 01 Apr 1999 11:37:37 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Running a perl script as a daemon....
Message-Id: <3703CB01.FBD5B4CF@mail.cor.epa.gov>

David Delikat wrote:
> 
> Tad McClellan wrote:
> >
> > David Delikat (ddelikat@protix.com) wrote:
> > : Tad McClellan wrote:
> > : > Diggy Tim (tim@diggy.com) wrote:
> > : >
> > : > : Subject: Re: Running a perl script as a daemon....
> > : >                                           ^^^^^^
> > : >                                           ^^^^^^
> > : > : How do I go about running a perl script from the command line and have it
> > : > : sit in the background and not die when I log out.
> > : >
> > : >    What happened when you did a word search in the Perl FAQs
> > : >    before posting?
> >
> > [ snip quoted signature]
> >
> > : oh for crying out loud, I just joined this group
> >
> >    Welcome.
> >
> > : and the first thing I
> > : see is some bonehead
> >
> >    Oh yeah?
> >
> >    Well ...    ... your feet stink!
> 
> all the way to texas? ( from WI ) I did shower this morning.
> 
> >
> >    So there.
> >
> > : picking on spelling, and it isn't even wrong.
> >                            ^^^^^^^^^^^^^^^^^^^
> >
> >    Which did not suggest to you that picking on spelling
> >    was not what I was doing at all?
> >
> 
> munch munch
> 
> >    I was telling him how to find the definitive answer to his
> >    question in the standard Perl docs.
> >
> 
> munch munch
> 
> >    I don't think you have to worry about me following up to any
> >    of your future postings with spelling corrections...
> >
> > --
> >     Tad McClellan                          SGML Consulting
> >     tadmc@metronet.com                     Perl programming
> >     Fort Worth, Texas
> 
> thank you for a nice complete answer.  my misunderstanding is
> greatly enlightened by good healthy comunications.
> 
> -dav
> 
> PS. Why didn't anyone else notice this?

We're all used to Tad's answers.  :-)

> PPS. ( PSS? ) munch munch, I think I've had enough crow for today.

Don't worry about it.  You've still made fewer errors on this
newsgroup than I have.  Or just about anybody else.  Even 
Randal makes a mistake every decade or so.

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 01 Apr 1999 12:06:54 -0800
From: alf2@swbell.net (Josh ''RudeSka'' Rush)
Subject: Stupid questions
Message-Id: <nlQM2.5322$dF4.15988325@WReNphoon1>

I am a perl newbie, but I do know perl, and I have some stupid questions,
hence my topic -- "Stupid questions."  my first [stupid] question is: how do
you do CGI with perl?  My second: how do you do graphics and/or GUI with
perl?



**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****


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

Date: Thu, 01 Apr 1999 15:36:00 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Stupid questions
Message-Id: <linberg-0104991536000001@ltl1.literacy.upenn.edu>

In article <nlQM2.5322$dF4.15988325@WReNphoon1>, alf2@swbell.net (Josh
''RudeSka'' Rush) wrote:

> I am a perl newbie, but I do know perl,

Um... that's an interesting pair of statements to join together.

> and I have some stupid questions,
> hence my topic -- "Stupid questions."  my first [stupid] question is: how do
> you do CGI with perl?

The same way you do CGI with any other language.  Have your perl code
begin by printing an HTML header, then print your output.  See CGI.pm for
extensive documentation.

>  My second: how do you do graphics and/or GUI with
> perl?

With the appropriate modules from CPAN.

Have fun!

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: Thu, 01 Apr 1999 12:00:25 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Text::Soundex for languages other than English?
Message-Id: <3703D059.9618CF8E@mail.cor.epa.gov>

Jed Parsons wrote:
> Greetings -
> Does anyone know of a module like Text::Soundex that is modeled on a language
> other than English?  I want to use it to compare Latin words, so some
> Romance language would be useful.

You might want to start with the soundex algorithm in Knuth.  It may not be
at all what you're hoping for.  It doesn't 'match' words so much as hash all
words into a small space.

The pronunciation of consonants in English is nearly that of Latin (except 
for the 'j') so you should be able to adapt Text::Soundex in a fairly 
straightforward manner.

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 1 Apr 1999 16:35:13 -0500
From: "S.Faust" <sfaust@isi-mtl.com>
Subject: Re: trying to build C like structure in perl
Message-Id: <syRM2.1067$o05.511@weber.videotron.net>

ok tks a lot for the pointers.


Don Roby <droby@copyright.com> wrote in message
news:7e01ih$6vh$1@nnrp1.dejanews.com...
> In article <kxHM2.2$o05.104@weber.videotron.net>,
>   "S.Faust" <sfaust@isi-mtl.com> wrote:
> > I'm kinda new to perl and I'm trying tom build C like structure.
> >
> > here is the code I was able to write.
> >
> > sub deux_struct{
> >
> >  $struct{name}[0]  =  "mike";
> >  $struct{name}[1] =  "steve";
> >  $struct{age}[0] = 10;
> >  $struct{age}[1]  = 20;
> >
> >  foreach $element ( keys %struct ) {
> >   foreach $i ( 0 .. $#{ $struct{$element} } ) {
> >    print $struct{$element}[$i] . "\n";
> >   }
> >  }
> > }
> >
> > is there a better way to build them?
>
> There are other ways to initialize it that might be clearer.  Take a look
at
> perldsc for some good examples.  There's also alot of info in perlref and
> perllol on stuff like this.
>
>
> > I tried to print the element like
> > $struct{name}[0] . $struct{age}[0] in the same line with a loop that
attach
> > the 2 element together but I was unable ( maybe I just need to take my
eyes
> > off the code
> > and go sleep a bit).  Anyone that have a way to do that I would
appreciate
> > some pointers.
> >
>
> Sleep is good. Since you have a hash of lists, and there's no guarantee
that
> all lists in the hash will have the same size, there's not a real natural
way
> to do it.  If you know they all have exactly two entries, you can
certainly
> do something like
>
> for (0..1) {
>    print $struct{'name'}[$_] . $struct{'age'}[$_] . "\n";
> }
>
> Emulating a C structure isn't necessarily the best way to deal with data
> structures in Perl though.  If you're storing info about people, and want
to
> retreive it based on name, you might do better to use a hash of hashes
with
> the actual names as first key, instead of having 'name' as a "fieldname"
key.
>  This makes it much easier to retrieve all the data on a particular
person.
>
> --
> Don Roby
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: Thu, 01 Apr 1999 18:53:01 GMT
From: fanxin@my-dejanews.com
Subject: Re: two questions need help
Message-Id: <7e0fa8$k9u$1@nnrp1.dejanews.com>


> Too many people know how to spam already. I for one will NOT cooperate
> in informing other people how to do it; in particular nontechnical
> people; those are the worst! (sausage?)

too bad, but u do help me.
i will search for a spam cgi program.
how come i forgot this word?
mailing list equals to a spam mail program. :)

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


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

Date: Thu, 01 Apr 1999 19:35:07 GMT
From: jazzy@spliff.net (The Jazenator)
Subject: Upload from CGI
Message-Id: <3703c933.12335437@nntp.stanford.edu>

I need to write a script that will create a file and upload it to a
client(Netscape or IE). I can't give the client any access to the
server (FTP or otherwise). Is there a CGI.pm function that will offer
a file for upload? 
My original thought was to have the file created, then copied into
htdocs. Then a client would click on a link that would upload that
file. That idea would leave the file open to the public (not ok) and
would bring up state problem (for removing the file afterwards). Does
anyone have an sugestion?
-Tucker


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

Date: Thu, 01 Apr 1999 14:26:34 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: The Jazenator <jazzy@spliff.net>
Subject: Re: Upload from CGI
Message-Id: <3703D67A.C1658B31@mail.uca.edu>

[cc'd to t]

The Jazenator wrote:
> 
> I need to write a script that will create a file and upload it to a
> client(Netscape or IE). I can't give the client any access to the
> server (FTP or otherwise). Is there a CGI.pm function that will offer
> a file for upload?
> My original thought was to have the file created, then copied into
> htdocs. Then a client would click on a link that would upload that
> file. That idea would leave the file open to the public (not ok) and
> would bring up state problem (for removing the file afterwards). Does
> anyone have an sugestion?

The easiest way would be to create a link to a "Mission Impossible" file
which would self-destruct (with accompanying smoke) after a short time
period. An almost as secure way would be to give the file some
random-alphanumeric name and send the client that name as a link back to
his/her browser. If you don't provide any links on "permanent" pages, it
is well-nigh invisible. Combining this with "MI" should solve both your
problems (except lazy clients who don't download your file in time, but
that's their problem, not yours). A good active ventilation system in
your server should take care of the smoke problem. ;^)

-- 
Cameron
camerond@mail.uca.edu


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

Date: Thu, 01 Apr 1999 20:25:04 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: URGENT
Message-Id: <3703d455.108254041@news.ford.com>

On Thu, 1 Apr 1999 10:51:09 +0200, "Markus Staas" <markus@umm.no> wrote:
>The Server Administrator cannot help me !

Only prozac can help you now.

Or, try these people.  They're good with cases like yours:

	http://www.kumc.edu/rainbow/


Next time, try:
	* Not yelling.
	* Speaking slowly, carefully, deliberatly, descriptively.
	* Asking a perl language question, not for a handout.

-- 
Clinton A. Pierce       "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org        Miracles."  -- Miracle Max, The Princess Bride
http://www.geeksalad.org


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

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

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