[12495] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6095 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 22 14:07:19 1999

Date: Tue, 22 Jun 99 11:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 22 Jun 1999     Volume: 8 Number: 6095

Today's topics:
    Re: 2 simple (not to me tho) questions <tchrist@mox.perl.com>
    Re: A month behind using localtime(time) ? <gbartels@xli.com>
    Re: A month behind using localtime(time) ? <emschwar@rmi.net>
    Re: A month behind using localtime(time) ? <flavell@mail.cern.ch>
        changing the name of an outputed file <sidelko@stripe.Colorado.EDU>
    Re: Database Manipulation paulm@dirigo.com
    Re: Database Manipulation paulm@dirigo.com
    Re: DIE DIE DIE Prisoners of Bill (was: How many questi <sb@sdm.de>
        fdghfg <darrenboyle@callnetuk.com>
    Re: Interpreting MS-ASCII - anyone have a filter? <flavell@mail.cern.ch>
    Re: Is there a way to access the volume label on a CDRW <cassell@mail.cor.epa.gov>
    Re: Net/FTP <cassell@mail.cor.epa.gov>
    Re: Newbie - Perl books - which to get? <gbartels@xli.com>
        newbie PWS idiocy part 2 <Sp.Ross@btinternet.com>
    Re: Newbie:VBQ (Very Basic Question) <ludlow@us.ibm.com>
        Perl Program (Sai Chimakurty)
        perldoc access via web (Was: Re: 2 simple (not to me th <ludlow@us.ibm.com>
    Re: Please help: Delete Reg Key with Sub-Keys. <cassell@mail.cor.epa.gov>
    Re: Question about TTY's... <portboy@home.com>
    Re: read files in Perl <rootbeer@redcat.com>
    Re: Simple Question (I think) <uri@sysarch.com>
    Re: simple requirement..help please! <cassell@mail.cor.epa.gov>
    Re: Statistics for comp.lang.perl.misc (Paul David Fardy)
    Re: Statistics for comp.lang.perl.misc <cassell@mail.cor.epa.gov>
    Re: Statistics for comp.lang.perl.misc <tchrist@mox.perl.com>
    Re: Unsigned integer behavior (Andrew Allen)
    Re: Upload Module? <cassell@mail.cor.epa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 22 Jun 1999 11:38:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <376fca25@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Jason Reed <jcreed@cyclone.jprc.com> writes:
:sub inc { ++$_[0] }
:$a = 7;
:$b = 7;
:inc $a
:results in $a == 8.
:inc "$b" 
:evaluates to 8 but leaves $b intact. And, of course,
:inc 7
:is an error.

Good stuff.  I'll add it to the nascent FAQ.

--tom
-- 
I hope to get Perl 5 out this summer, for certain values of summer.
        -- <1993Jun5.052825.3897@netlabs.com>


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

Date: Tue, 22 Jun 1999 12:18:29 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <376FB755.3FB74B56@xli.com>

Tom Christiansen wrote:
> That is inadequate and irrelevant.  It's also wrong.  I don't care if
> you're a Prisoner of Bill.  I don't care that you couldn't type in a
> command line to save your life.  Perl comes with complete documentation.
> Every single place where perl is, there's its complete documentation
> waiting for you, calling out to you.  We didn't spend years of our lives
> for you to ignore it.  If you don't have its docs, you don't have perl.
> Reinstall until you find them.  Make sure to reboot a lot.  You have
> Perl documentation.  Use it.  Read it.  Search it.  Grep it.  Write your
> own searchers.  Perl and this newsgroup shall not adapt themselves to
> the Microsoft illiterati.  *You* shall adapt to us, or you shall fetch
> us our fries.  Chop-chop!

gees, now who got blood splattered all over the newsgoup?
someone ought to mop this up, or we'll lose our PG rating.

;)

Greg


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

Date: 22 Jun 1999 11:30:55 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <xkf7lowm9bk.fsf@valdemar.col.hp.com>

Mark Conlin <Mark.Conlin@bridge.bellsouth.com> writes:
> ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
> localtime(time);
> 
> When I use this command I end up with $mon, being 5, correct me if 
> I am wrong but it is June isn't. No big deal I just add one, I was
> just wondering why PERL does this.

Because that's what it's been explicitly documented to do?  

Did you actually read the documentation of localtime?  If you had, you'd
have seen this behaviour explicitly documented.

> Does that mean that January is $mon 0 ?

Wow, you *are* good.

-=Eric


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

Date: Tue, 22 Jun 1999 19:17:53 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <Pine.HPP.3.95a.990622191453.26049A-100000@hpplus03.cern.ch>

On Tue, 22 Jun 1999, Mark Conlin wrote:

> > Stop programming by guesswork, or take up another trade.
> 
> Now, be nice. If is so troublesome of a task to read and reply to 
> this message that you feel the need to insult me then why did you
> do it ? No one is forcing you to respond. 
> 
> I don't have a reference book here and my connection is so terrible
> that it makes using the web faqs impossible. In addition the fact that
> I did not understand the behavior of a perl command does not mean that
> I need to switch jobs. 

It is better to remain silent and be suspected a fool, than to open
one's mouth and remove all doubt. 

You just removed all doubt.



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

Date: Tue, 22 Jun 1999 11:27:59 -0600
From: Sean Sidelko <sidelko@stripe.Colorado.EDU>
Subject: changing the name of an outputed file
Message-Id: <Pine.GSO.3.96.990622112513.28767C-100000@stripe.Colorado.EDU>

I wrote a script that takes a gzipped midi and outputs as a normal
ungzipped midi file.  i was wondering if there was a way that i could
easily change the name of the outputed midi file to something other then
the name of the script.  

Sean






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

Date: Tue, 22 Jun 1999 17:13:50 GMT
From: paulm@dirigo.com
Subject: Re: Database Manipulation
Message-Id: <7kog83$ees$1@nnrp1.deja.com>

Since I have a viewable forecast now, how would I construct a Perl
script that will take the values that the initial query comes up with,
and places them in text boxes so that the sales people can edit them?

Then, once the changes are made, they can push submit to UPDATE the
valuse in the database.

Does that make sense?

In article <376F90C5.C0AE921C@dave.org.uk>,
  Dave Cross <dave@dave.org.uk> wrote:
> paulm@dirigo.com wrote:
> >
> > Pretty simple right?  Well, if you know please give me a hint :)
>
> Sounds simple enough. What was your question?
>
> Dave...
>

--
Paul R. Mesker
System Engineer
Dirigo Inc.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 22 Jun 1999 17:32:13 GMT
From: paulm@dirigo.com
Subject: Re: Database Manipulation
Message-Id: <7kohat$et8$1@nnrp1.deja.com>

I basically just want the user to click a submit button that takes the
values they are viewing and puts them into text boxes or form cells.
Then, they can submit any values they change.

Right now, I have the values formatted to be placed into a table.  Can
I just replace this table with a form and form cells?

I'm not familiar with hashes, (or Perl...this is a learning experience
:) but I will give it a try.

Any other input will help.

Thanks!

In article <376FB4CC.F99D2E6C@cybersource.com>,
  Tim Forman <forman@cybersource.com> wrote:
> I have done this before where you take the database values and put
them
> into a hash, so you can call them out on demand.  You can then put
them in
> the form cells from the perl script as you write the html something
like
> this.
>
> #%x is some hash with sales values in it
> #put all of your form stuff in the print area
> print <<EOF;
> <form name="forecast" action="update.pl" method=POST>
> <input type=text size=12 name="sales_numbers" value="$x{sales_value}">
> <input type=button value=" SUBMIT " onClick =
> "Check_Fields(document.forecast);">
> EOF
>
> You'll need one form element for each sales number you'd like for
them to be
> able to
> edit of course. Then when you click on the submit you can pass the
values to
> another
> cgi to do the update.  I use JavaScript to do all of the error
checking in
> the form.  You
> can also use JavaScript to calculate the field values in the form
real time.
> This actually works well for the user.  I'm sure others have ideas as
well.
>
> Tim

--
Paul R. Mesker
System Engineer
Dirigo Inc.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 22 Jun 1999 17:45:06 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: DIE DIE DIE Prisoners of Bill (was: How many questions about localtime?)
Message-Id: <7koi32$4si$1@solti3.sdm.de>

[Posted && Mailed]

In article <376fb2b5@cs.colorado.edu>, Tom Christiansen <tchrist@mox.perl.com> wrote:

> :How many questions about the return values of localtime() does it take
> :before one goes mad reading this ng?

> I'm reposting the perlfunc and perlfaq entries.  I haven't updated them
> with your input.  Oh well.

> I strong encourage *everyone* to mail the whole flipping manual to *anyone*
> who asks an RTFM *everytime* they do so.  

Why not just ignoring them?
You're making your life miserable yourself.

Relax, calm down! Go fishing! Or whatever relaxes you. :-)

Best regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/
    http://www.engelschall.com/u/sb/download/
    http://www.perl.com/CPAN/authors/id/STBEY/
    http://www.oreilly.de/catalog/perlmodger/bnp/


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

Date: Tue, 22 Jun 1999 18:31:53 +0100
From: "Darren Boyle" <darrenboyle@callnetuk.com>
Subject: fdghfg
Message-Id: <376fca52@eeyore.callnetuk.com>

dfghdfgd




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

Date: Tue, 22 Jun 1999 18:59:57 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Interpreting MS-ASCII - anyone have a filter?
Message-Id: <Pine.HPP.3.95a.990622185456.11592B-100000@hpplus03.cern.ch>

On Tue, 22 Jun 1999, Philip 'Yes, that's my address' Newton wrote:

(NB ISO-Latin-1 == ISO-8859-1)

NB, pedantically, ISO-Latin-1 is a repertoire of characters, without
reference to their coding.  The ISO-specified character coding for the
Latin-1 repertoire is indeed ISO-8895-1, but the same repertoire of
characters is also included in CP850 and in one of the EBCDIC code pages
(it was called CECP1047 when I was involved in that stuff), as well as
in Windows-1252. 

all the best



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

Date: Tue, 22 Jun 1999 10:29:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Is there a way to access the volume label on a CDRW?
Message-Id: <376FC816.3DCA2C38@mail.cor.epa.gov>

rogdh wrote:
> I have a CDRW that I use for backup.
> 
> Sometimes, I forget to switch music CDs with my backup CDRWs
> at the end of the evening.
> 
> I'd like to test the volume label of the CDRW for a string to see if
> the correct CDRW is in the drive.
> 
> Is there a way....

Yes.  But the way isn't really a Perl question as much as it 
is a CD-format-issues question.  If you can find out (in another
newsgroup or from a website) the details of reading the volume
label, then you should be able to do that in Perl.. even if
it is calling some other program with qx// to get the output
for parsing or checking.  But the details will vary depending
on things like your OS, so I really can't give you much more
advice.. if you want to call this traife advice.  :-)

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


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

Date: Tue, 22 Jun 1999 10:38:23 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Net/FTP
Message-Id: <376FCA0F.740B7E95@mail.cor.epa.gov>

periwinkle96088009@my-deja.com wrote:
> [SNIP]
> Occasionally the server will come back with it's "Opening BINARY
> connection" but my ftp->put will not respond by sending the file.
> Eventually the SERVER will time out after 5 minutes! During this time
> the picture, currshot.jpg, is a zero length file serving no purpose
> other than to annoy visitors. After the 300 second timeout the server
> will close the control connection and the script will realize that the
> ftp->put didn't work, then close and reopen the ftp link.

Without a snippet of just the relevant code, it's pretty hard
to guess what the problem might be.  We're still trying to get
the PSI::ESP module out of alpha-test.  :-)

But you might start by significantly reducing the timeout.
The constructor for Net::FTP takes an optional timeout value,
which is supposed to have a default of 120 seconds (according 
to my docs, anyway).  You say you put that at 30 seconds, but 
your problem statement indicates that this is not happening.
I don't see why debug woud change this.  So, without a small
chunk of code from you to this newsgroup, I can't get much
farther.

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


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

Date: Tue, 22 Jun 1999 12:30:07 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: Newbie - Perl books - which to get?
Message-Id: <376FBA0F.E526F9B3@xli.com>

I have the O'reilly books:

Learning Perl (good starter)
Advanced Perl Programming 
(only source for object oriented stuff I've seen so far)
Programming Perl (bible/reference, all encompassing)
Perl Cookbook (a _lot_ of How do I ___? questions
 with the answers right below them)
Learning Perl/Tk

I also have "Perl5For Dummies" from IDG.

if  your doing any long term perl stuff,
I'd say get the whole lot of them.
(except maybe, the perl/Tk book, which
is only usefull to people using the
gui toolkit module)

Greg


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

Date: Tue, 22 Jun 1999 18:08:20 +0100
From: "Simon Ross" <Sp.Ross@btinternet.com>
Subject: newbie PWS idiocy part 2
Message-Id: <7kofn9$6dm$1@plutonium.btinternet.com>

I still can't get my scripts working on MS Personal Web Server.
I've consulted the ActiveState docs and it suggests that I need to make
changes to my registry (Script Map key)- is this correct? Shouldn't the Perl
installation have sorted this out for me? Any way, I made the changes and my
browser just sits there forever, not sending anything back.

Tell me which part I'm doing wrong:

1. Write simple script e.g:
    #!usr/bin/perl
    print <<END_of_html;
    Content-type: text/html

    <html>
    <body>
    <p>hello cruel world</p>
    </body>
    </html>

    END_of_html;

2. save to SCRIPTS directory as hello.pl
3. in browser, type http://localhost/scripts/hello.pl
4. wait for two possible outcomes:
    a) browser waits forever, returning no content (this is WITH registry
changes); or....
    b) browser returns above script WITHOUT executing it,ie as raw text.
(this is WITHOUT registry changes).

So: how do I get the perl interpreter to execute my script on 'server side'
BEFORE returning result?

YES - my PC knows and understands the .pl/.plx extensions and runs my
scripts fine from the command line.
YES - my execute and script permissions HAVE been set properly.

Any feedback would be greatly appreciated - I know it must be something
stupidly simple!
Ross.








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

Date: Tue, 22 Jun 1999 09:40:30 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Newbie:VBQ (Very Basic Question)
Message-Id: <376FA05E.3E631281@us.ibm.com>

Stuart, Xinlu and Niuniu wrote:
> 
> I just purchased a book "Perl 5 By Example" that came with perl5 on a
> cd. I installed it, it appears to be working. I typed   print("blah blah
> blah ,\n");      in notepad and named it test.pl
> Tried to run it and nothing happened. I know this is beyond basic but I

What does "tried to run it" mean?  Open a DOS window and change to the
directory that contains test.pl.  At the command prompt type 'perl
test.pl' (without the quotes).  If that doesn't work, but you're sure
that you installed perl, it's likely a path problem (check your
autoexec.bat).

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: 22 Jun 1999 16:31:49 GMT
From: saic@shirdi.corp.sun.com (Sai Chimakurty)
Subject: Perl Program
Message-Id: <7kodpl$23g$1@corpnews1.Corp.Sun.COM>

Hi,

        I am new to perl programming. I am trying to write a perl program.

        There is a process. It has sub-processes and it inturn has
        sub-processes. In my daily routine, I get the process number of
        the main process. Get all the sub-process, and then get all the
        sub-sub-processes by issuing "ps -ef |grep process", kill each
        one individually. It is taking more than half an hour for the
        entire process. For this I want to write a perl program which
        kills process and its sub-process and its sub-process and so on.

        Any one with any idea, please help me. It would be of great
        help to me. Thank you in advance.


Thanks & Regards,
Sai Chimakurty          Email:Sai.Chimakurty@Sun.com

        ******************************************
        Without Humility there can be no Humanity.
        ******************************************



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

Date: Tue, 22 Jun 1999 09:46:51 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: perldoc access via web (Was: Re: 2 simple (not to me tho) questions)
Message-Id: <376FA1DB.B7D75486@us.ibm.com>

Weborium wrote:

> PS.
> I don't have the perl docs, so I can't do the perldoc thing. I'm testing the
> scripts on a DOS version with only perl.exe.

But doesn't AOL give you web access?  If so, then you do have access to
the perldoc information.

Starting at:
http://www.perl.com/

You can follow the links to the Perl documentation:
http://www.perl.com/CPAN-local/doc/manual/html/pod/index.html

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Tue, 22 Jun 1999 10:05:05 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: roberthp@my-deja.com
Subject: Re: Please help: Delete Reg Key with Sub-Keys.
Message-Id: <376FC241.BA236598@mail.cor.epa.gov>

[courtesy cc to poster]

roberthp@my-deja.com wrote:
> 
> Hello folks:
> 
> I'm totally new to this Perl thing (just started today), and I'd like
> to figure out how to delete a registry key that has sub-keys.  The key
> I'm trying to delete is:

Whoa!  Your first day with Perl and already you're risking
your entire OS?  You're far braver than I am.  I highly
recommend that your first programming task with a new language
*not* be something which can cause major damage and even 
toast your machine.  Win32 registry damage can be nasty to
repair, so please keep backup copies ready.

That said, you might want to take your question to the
Win32-Perl-users listserv, which is *very* win32-centric.
Go to http://www.activestate.com/support/mailing_lists.htm
to subscribe.  You could get your question answered in hours.
It might even be a correct answer.

> [SNIP]
> Can anyone just give me a code snippet on how to delete a key with sub-
> keys, or point me to some code?  It *has* to be fairly straight-
> forward, but not being a programmer is really hampering my ability to
               ^^^^^^^^^^^^^^^^^^^^^^
> figure this out.

Robert, now you're really making me worry.  Are you sure you
don't want to start with some less risky tasks and work your
way up?

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


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

Date: Tue, 22 Jun 1999 17:51:33 GMT
From: Mitch <portboy@home.com>
Subject: Re: Question about TTY's...
Message-Id: <376F5D44.94C23F68@home.com>

Hey, thanks for the help....I have an interesting solution, however, I'm not
sure of how to implement this.
So, let's assume a user walks up and plugs in a modem with echo turned on.
In this scenario, my interface will begin spewing the error "I don't
recognize that command..." over and over.  So, what I would like to be able
to do, is somehow check what is being spewed out the interface, and if I see
a lot of the "I odn't recognize that command..." over a short period of time,
I will essentially begin "chattering with myself".  "Chatting with myself"
means that nothing is spewed anymore until the frequency of "I don't
recognize that command..." ceases.  So, how can I do that?

Andrew J Perrin wrote:

> Well, if I understand you right you're worried about a sort of loop where
> you'll be simply receiving echoes of your own transmits.  How about
> checking this periodically (or perhaps just once at the beginning),
> something like:
>
> print "$$.testpacket.$$\n";
>
> and see if you get it back Including the $$ (the script's pid) will give
> you a pretty good chance that your remote machine doesn't happen to be
> sending that string by chance; if you're worried you could make it more
> unique, say by squaring, cubing, etc., the pid.
>
> Andy Perrin
>
> Mitch wrote:
>
> >  So, in theory, iIf someone were
> > to short RX and TX on the TTY (either directly, by connecting pins 2+3
> > or by connecting a modem with echo turned on, I don't want the script
> > to run away sending a 'syntax error' and then reading that as input
> > and issueing another 'syntax error' (and so on...).
>
> -------------------------------------------------------------
> Andrew J. Perrin - NT/Unix/Access Consulting -  (650)938-4740
> aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
>      http://www.geocities.com/SiliconValley/Grid/7544/
> -------------------------------------------------------------



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

Date: Tue, 22 Jun 1999 10:44:48 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: read files in Perl
Message-Id: <Pine.GSO.4.02A.9906221042280.1698-100000@user2.teleport.com>

On Tue, 22 Jun 1999, Treble Clef wrote:

> I have tried in vain to get this working, but I
> keep getting 
> 
>  28: Syntax error: "(" unexpected  

That's not a normal Perl error message. Maybe your #! line is incorrect or
not being used properly by your system. 

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Jun 1999 13:02:19 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Simple Question (I think)
Message-Id: <x73dzk88ys.fsf@home.sysarch.com>

>>>>> "GB" == Greg Bacon <gbacon@itsc.uah.edu> writes:

  GB> In article <MPG.11d952b57f314a91989c1b@nntp.hpl.hp.com>,
  GB> 	lr@hpl.hp.com (Larry Rosler) writes:
  GB> : In article <7knb1k$mql$1@plonk.apk.net> on Tue, 22 Jun 1999 03:09:14 -
  GB> : 0400, Jody Fedor <JFedor@datacom-css.com> says...
  GB> : > This might be "Perl Baby-Talk" but it will get the job done.  I'm sure Larry
  GB> : > (Rosler) might have a million better ways to do this, he is the King of
  GB> : > Simplicity.
  GB> : 
  GB> : No, the Forrest Gump of Simplicity.
  GB> : 
  GB> :   $rec = do { local $/; <LOGS> };

  GB> To think some people say you need the File::Slurp module to do this.
  GB> Sigh. :-(

but i like using my read_file/write_file sub as they do the open/close,
return the file or lines, deal with errors, etc. no need for a module,
just a nice short, clean sub.

uri


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


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

Date: Tue, 22 Jun 1999 10:08:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: simple requirement..help please!
Message-Id: <376FC32A.E2F7C911@mail.cor.epa.gov>

Raj wrote:
> 
> Hi,
> I have a shellScript "prog.sh". How do i call this from within my
> CGI/Perl Script??
> I used system command but it is not executing at all. Any help
> please!!!! TIA,

Wait, you just asked this less than 6 hours earlier.  And you
got an answer to that post!  What more do you want from us?

If you used system() and it didn't work, why don't you show us
a snippet of code (less than 10 lines should do here) which
illustrates what you did and what didn't work.  Because it
should work.  Even if it is really inefficient to be calling
shell scripts from Perl, when Perl can do everything that's
in the shell script.. usually better and faster, with fewer
calls to external programs.

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


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

Date: 22 Jun 1999 17:39:43 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <7kohov$dks$1@coranto.ucs.mun.ca>

Bart Lateur (bart.lateur@skynet.be) wrote:
>> The only way to beat that, is to use more than one quoting prefix
>> in one post, which *definitely* is bad Usenet prectise, and qhould
>> be frowned upon, as it will no longer be easily identifiable as
>> quoting, for the human reader, also.

abigail@delanet.com (Abigail) writes:
>  I don't think it's hard to identify what is quoted and what isn't.

Indeed.  What regular expression(s) would you use to identify
quoted material?

Paul Fardy


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

Date: Tue, 22 Jun 1999 10:48:26 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <376FCC6A.B17348F6@mail.cor.epa.gov>

Bart Lateur wrote:
> [a lot of interesting suggestions]

A simpler heuristic for Abigail's posts:
If the line is not "RTFM", "RTFFAQ", or "Abigail" then
it's quoted.

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


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

Date: 22 Jun 1999 11:55:20 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <376fce08@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    pdf@morgan.ucs.mun.ca (Paul David Fardy) writes:
:Indeed.  What regular expression(s) would you use to identify
:quoted material?

I use this, although there's certainly room for improvement.

--tom

#!/usr/local/bin/perl -w
#
# cfoq: check for overquoted by tchrist@mox.perl.com
#   (wants perl 5.0 or better; developed under 5.002)
#
# INPUT:   a news article
# OUTPUT:  if -v, then shows how much it found and where
#
# OPTIONS: -v for verbose flag
#	    -t NN to change tolerance percentage from 50%
#	    -m for minimum lines that get subject to percentage counting;
#		otherwise, it just checks for ANY new lines.  This way 
#		short little 6-line messages with 4 lines of quoting don't
#		get hassled
#
# EXIT:	   2 (bad failure) if no new lines
#	   1 (failure)     if tolerance exceeded
#	   0 (success)     otherwise

# 5.0 might work, but I developed it under 5.002
require 5.002;  

use strict;

use vars qw{
    $MINLINES  $opt_m 
    $VERBOSE   $opt_v
    $TOLERANCE $opt_t
}; 

use Getopt::Std;
getopts("vt:m:") || die "usage: $0 [-v] [-t tolerance] [-m minlines] [input_file]\n";

my (
    $total, 		# total number of lines, minus sig and attribution
    $quoted_lines, 	# how many lines were quoted
    $percent, 		# what percentage this in
    $pcount, 		# how many in this paragraph were counted
    $match_part,	# holding space for current match
    $gotsig,		# is this the sig paragraph?
);

$total = $quoted_lines = $pcount = $percent = 0;

$MINLINES  = $opt_m || 20;
$VERBOSE   = $opt_v;
$TOLERANCE = $opt_t || 50; 

$/ = ''; 	# set record reading to paragraph mode
<ARGV>;   	# consume and discard header of message

while (<ARGV>) {

    # strip sig line, remember we found it
    $gotsig = s/^-- \n.*//ms;

    # strip attribution, possibly multiline
    if ($. == 2) { s/\A.*?(<.*?>|\@).*?:\n//s }  

    # toss trailing blank lines into one single line
    s/\n+\Z/\n/;

    # now reduce miswrapped lines from idiotic broken PC newsreaders
    # into what they should have been
    s/(>.*)\n\s*([a-zA-Z])/$1 $2/g;

    # count lines in this paragraph
    $total++ while  /^./mg;

    # is it a single line, quoted in the customary fashion?
    if ( /^(>+).*\n\Z/ ) {
	$quoted_lines++;
	print " 1 line  quoted with $1\n" if $VERBOSE;
	next;
    } 

    # otherwise, it's a multiline block, which may be quoted
    # with any leading repeated string that's neither alphanumeric
    # nor string
    while (/^(([^\w\s]+).*\n)(\2.*\n)+/mg) {  # YANETUT
	$quoted_lines += $pcount = ($match_part = $&) =~ tr/\n//;
	printf "%2d lines quoted with $2\n", $pcount 	if $VERBOSE;
    } 

    last if $gotsig;
} 

$percent = int($quoted_lines / $total * 100);
print "$quoted_lines lines quoted out of $total: $percent%\n"
						    if $VERBOSE;

if ($total == $quoted_lines) {
    print "All $total lines were quoted lines!\n"   if $VERBOSE;
    exit(2);
}

if ($percent > $TOLERANCE) { 
    if ($total < $MINLINES) {
	print "but since $total is less than $MINLINES lines, that's ok\n"
						    if $VERBOSE;
	exit 0;
    } else { 
	exit 1;
    }
} else {
    exit 0;
} 
-- 
Doing linear scans over an associative array is like trying to club someone
to death with a loaded Uzi. --Larry Wall


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

Date: 22 Jun 1999 17:16:20 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Unsigned integer behavior
Message-Id: <7kogd4$bn$1@fcnews.fc.hp.com>

Ilya Zakharevich (ilya@math.ohio-state.edu) wrote:
: [A complimentary Cc of this posting was sent to Peter Friend
: <octavian@earthlink.net>],
: who wrote in article <7kmid7$9d6$1@oak.prod.itd.earthlink.net>:
: > Is there a way to get unsigned integer behavior? The integer module
: > uses signed integers.

: AFAIK there is absolutely no difference between signed and unsigned
: arithmetic.

This is true in perl-land and arithmetic-land. In C-land, it's true as
long as you don't overflow. If you _really_ want to emulate C's
unsigned overflow behavior, you'll probably need to write your own
"integer32" class, or some such thing. "perldoc overload" can help
with the syntax.

Andrew


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

Date: Tue, 22 Jun 1999 10:14:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Matt <splinter@monmouth.com>
Subject: Re: Upload Module?
Message-Id: <376FC459.3D0F3BB1@mail.cor.epa.gov>

[courtesy cc sent to poster]

Matt wrote:
> Hi,

Howdy,

> Anyone know of any modules used for uploading images of types such as .gif
> or .jpeg.  I'm sure they are out there, I have seen some I'm pretty sure but
> I need an opinion on a "best one".

Well, a 'best' one will be highly dependent on your requirements.

Do you want this so that your CGI script can help people upload
images to your site?  If so, you'll probably want to get CGI.pm,
which you should want for many other purposes as well.  It's
far better than using the assorted random luser scripts on the
web which pretend to be Good Things.

If you just want to go out and snag images off ftp sites, you'd
want Net::FTP .

And in other cases, other modules may be the best for your
purposes.

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


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

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

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