[11771] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5371 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 13 11:07:31 1999

Date: Tue, 13 Apr 99 08:01:30 -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, 13 Apr 1999     Volume: 8 Number: 5371

Today's topics:
    Re: program interaction using <<HERE docs (Daniel Beckham)
    Re: Putting a pause or a delay within a perl program (Jonathan Stowe)
    Re: SORT BY DATE <jwarner@tivoli.com>
        String matching <vkemppin@comptel.com>
    Re: String matching (Sam Holden)
    Re: String matching <gellyfish@gellyfish.com>
    Re: String matching (David Cantrell)
        TPJ still shipping? <revjack@radix.net>
    Re: Trouble with exec() and system() in CGI <dimitrio@fantom.com>
    Re: Typeglobs broken by threaded perl??? <bbense+comp.lang.perl.misc.Apr.13.99@telemark.stanford.edu>
    Re: URGENT (Daniel Beckham)
    Re: Where we can get perl code snippets? <dimitrio@fantom.com>
    Re: Where we can get perl code snippets? <okmail@hanmail.net>
        Win32 IPC <gmorgan@photographics.co.uk>
        WinNT Services <gmorgan@photographics.co.uk>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 13 Apr 1999 09:33:15 -0500
From: danbeck@qual.net (Daniel Beckham)
Subject: Re: program interaction using <<HERE docs
Message-Id: <MPG.117d11a5fc381eea989683@news.idt.net>

Yep, you can do a hell of a lot more damage running rogue perl scripts 
than installing a well know module that is publicly available and 
publicly used by many people without problems...

Sounds like you have a dick on your hands... either he's old as shit and 
extremely set in his ways or he doesn't really like you...  Buy him 
flowers.

Daniel

In article <1dpk05x.5sr3gvasf3p3N@p88.tc2.state.ma.tiac.com>, 
rjk@linguist.dartmouth.edu says...
> Christian M. Aranda <christianarandaOUT@OUTyahoo.com> wrote:
> 
> > FYI - I wasn't ignoring his help.  I stated a couple of times that the
> > sysadmin WILL NOT let a module be on his machine.  Period.  End of
> > story.  It doesn't matter where I put it.  Period.
> 
> But he'll let you run arbitrary Perl scripts on his machine?
> That's really weird.
> 
> 


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

Date: Tue, 13 Apr 1999 11:07:09 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Putting a pause or a delay within a perl program
Message-Id: <3713253e.11710757@news.dircon.co.uk>

On Tue, 13 Apr 1999 09:58:43 GMT, Thu Ra Tin <thuratin@home.com>
wrote:

>Hello there,
>
>What would be the best way to put a delay in a program?  For example, I
>want the program to pause for about 30 seconds to 2 minutes before
>continuing.
>

sleep() 

/J\


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

Date: Tue, 13 Apr 1999 08:38:25 -0500
From: John Warner <jwarner@tivoli.com>
Subject: Re: SORT BY DATE
Message-Id: <371348D1.2406FA72@tivoli.com>

If I had thought about the Perl dependency on the OS for time, and the size
of variables used by the OS, I would have answered my own question.  (That
deserves a great big Homer Simpson "Doh!")  The error you get on NT is
related to the NT epoch which starts Jan 1, 1900 or 1901 (I forget which).

Larry Rosler wrote:

> [Posted and a courtesy copy sent.]
>
> In article <3712025F.EE5BA50@tivoli.com> on Mon, 12 Apr 1999 09:25:35 -
> 0500, John Warner <jwarner@tivoli.com >says...
> > Your reply brings up an interesting question for me.  How does Perl
> > handle dates before 1900?  Does it simply return a negative number?
>
> By 'it' I presume you mean the functions gmtime() and localtime().
>
> They don't have to deal with it, because the domain of the function is
> the Unix epoch, which starts at Thu Jan  1 00:00:00 1970 UTC
> [gmtime(0)].  Negative arguments work on the Unix implementations I have
> tested, but ActivePerl fails with an 'uninitialized value' error.
>
> As the gmtime() function seems to clip the largest negative argument to
> the integer -(2 ** 31), the earliest value the Unix implementations
> return is Fri Dec 13 20:45:52 1901.  This is greater than 1900, so your
> question is moot.
>
> What a miracle of design!
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com

--

John Warner                      Tivoli Systems Inc.
Sales Support Engineer           9442 Capital Of Texas Hwy North
Sales Infrastructure Group       Austin, TX 78759
john_warner@tivoli.com




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

Date: Tue, 13 Apr 1999 14:43:37 +0300
From: "Ville Kemppinen" <vkemppin@comptel.com>
Subject: String matching
Message-Id: <7evaq7$73v$1@news.kolumbus.fi>


Hello!

This is possibly a faq but anyway.

What is the easiest way to check if 14. character in a string is
for example D?

Example:

$string = LSDJFLKSDJFLKJSDLFJSLF;
                                ^

And now how do I check if is D or K?


Regards,
Ville




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

Date: 13 Apr 1999 12:33:46 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: String matching
Message-Id: <slrn7h6eda.lju.sholden@pgrad.cs.usyd.edu.au>

 Ville Kemppinen <vkemppin@comptel.com> wrote:
>
>Hello!
>
>This is possibly a faq but anyway.
>
>What is the easiest way to check if 14. character in a string is
>for example D?

perldoc -f substr

-- 
Sam

compiling kernels is what I do most, so they do tend to stick to the
cache ;)	--Linus Torvalds


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

Date: 13 Apr 1999 13:32:33 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: String matching
Message-Id: <37133961.0@newsread3.dircon.co.uk>

Ville Kemppinen <vkemppin@comptel.com> wrote:
> 
> This is possibly a faq but anyway.
> 

You could have checked with the docs first of course

> What is the easiest way to check if 14. character in a string is
> for example D?
> 
> Example:
> 
> $string = LSDJFLKSDJFLKJSDLFJSLF;
>                                 ^
> 
> And now how do I check if is D or K?
> 
> 

You can use substr():

$char = substr($string,13,0);

that will get the 14th character which you can then test as you will.

Alternatively you could use a regex:

if ( $string =~ /^.{13}([DK])/)
  {
    # 14th character is D or K
    # Character is in $1
  }

etc ...

check out the perlfunc and perlre manpages for illumination.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Tue, 13 Apr 1999 14:50:17 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: String matching
Message-Id: <371358c8.337623336@news.insnet.net>

On Tue, 13 Apr 1999 14:43:37 +0300, "Ville Kemppinen"
<vkemppin@comptel.com> enlightened us thusly:

>
>Hello!
>
>This is possibly a faq but anyway.

Hmmm ... you are aware of the concept of FAQs and yet you still post
your question without bothering to check if it is a FAQ or not?

>What is the easiest way to check if 14. character in a string is
>for example D?

if($string=~/^.{13}D/) { print "14th char is D\n"); }

>And now how do I check if is D or K?

if($string=~/^.{13}[KD]/) { print "14th char is either K or D\n"); }

See perldoc perlre for an explanation of how the above examples work.

[Copying newsgroup posts to me by mail is considered rude]

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: 13 Apr 1999 14:41:22 GMT
From: Wappinger Mary <revjack@radix.net>
Subject: TPJ still shipping?
Message-Id: <7evl2i$mph$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Is The Perl Journal still shipping? I ordered a year's subscription and
all the back issues almost a month ago, and I have yet to receive them.
Mail to Mr. Orwant doesn't seem to be getting me anywhere.

Has anyone else successfully purchased TPJ?

-- 
  /~\  discomfit Pennsylvania Barlow infest fireproof winemaster expli
 C oo  convulse abreact consist Beauregard biscuit Goldstine nuclide a
 _( ^) 1 , 0 0 0 , 0 0 0   m o n k e y s   c a n ' t   b e   w r o n g
/___~\ http://3509641275/~revjack  04/13/99 10:40:02 revjack@radix.net


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

Date: Tue, 13 Apr 1999 13:33:41 GMT
From: Dimitri Ostapenko <dimitrio@fantom.com>
Subject: Re: Trouble with exec() and system() in CGI
Message-Id: <37134870.8DA4BFFB@fantom.com>

Why don't you check your pwd and permissions?

ajeet@my-dejanews.com wrote:

> Hi all!
>
> I have a CGI script where, I need to delete a temp file created by another
> script. But, whenever I run the script file on the server using:
> exec("del $filename"); or system("del $filename"); or unlink(<$filename>);
> It doesnt work as long as it is inside the "Content type" header of CGI
>
> But, when I run it from the command line, it performs the system function.
> Why is that so??? Any idea anybody?
>
> Thanx
> -Ajeet
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own



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

Date: 13 Apr 1999 14:22:29 GMT
From: <bbense+comp.lang.perl.misc.Apr.13.99@telemark.stanford.edu> ;
Subject: Re: Typeglobs broken by threaded perl???
Message-Id: <7evjv5$rk0$1@nntp.Stanford.EDU>



In article <7eiha8$3fq$1@news.nist.gov>,

[stuff about $_ and threads deleted ]
>
>But does it really need that? Dynamical binding $_, ie. local($_), in 
>a thread should keep it separate from any other thread's $_.  Since
>everything defaults to $_, the catch is people use it without realizing.
>But any reusable piece of code that mungs with $_, either has to bind it, 
>or advertise it, anyway... threads or no.
>

- - I think there is a problem with the statement 

"But any reusable piece of code that mungs with $_"

It's pretty much an oxymoron in my book. Reusable code 
does not mung with $_. 

- - I regret posting this already... 

- - Booker c. Bense 



Version: 2.6.2

iQCVAwUBNxNTIQD83u1ILnWNAQGFgQP6A/SmH5QOKHVos6IbFDl6MOPkkKaxhnyc
mCEvusGnUfDLxmN6QZcQ+wog0cxB4y9c7NPmHXByWtAMorF2p8CpgW2IFchKJqMl
zWMUPZktsVUpl5A1P3UwHw6IqdsFuWq7m1rTbLJdUhG2mU2vyyteVxPZILwtZ41V
dC3aqeaQyNs=
=wjmF
-----END PGP SIGNATURE-----


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

Date: Tue, 13 Apr 1999 09:43:40 -0500
From: danbeck@qual.net (Daniel Beckham)
Subject: Re: URGENT
Message-Id: <MPG.117d1416e6cc933b989686@news.idt.net>

It sounds like he needs to get some real tech guys on his staff... 
someone who doesn't use multiple punctuation... as if we can't tell he's 
desperate by his words alone.

Daniel

In article <eDLM2.616$eJ.116170@news.shore.net>, upsetter@ziplink.net 
says...
> Markus Staas <markus@umm.no> wrote:
> : I forgot the beginning of my request above !!!!!!
> 
> : I have to use a form processing script.
> : I tried a lot like FormMail and so on, but since Iam not a Perl Guy I don4t
> : know what to do anymore !!!
> 
> : PLEASE PLEASE HELP ME !!!!   :-))))))))))
> 
> It sounds like you need to hire a consultant.
> 
> --Art
> 


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

Date: Tue, 13 Apr 1999 13:45:47 GMT
From: Dimitri Ostapenko <dimitrio@fantom.com>
Subject: Re: Where we can get perl code snippets?
Message-Id: <37134B49.C0B07257@fantom.com>

Jonathan Stowe wrote:

> On Tue, 13 Apr 1999 16:17:53 +0900,
> =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?= <okclub@communitech.net>
> wrote:
>
> >Where is perl code snippets??
> >
>
> Hang around here long enough and you'll see hundreds - ranging from
> small fragments to almost complete programs.
>
> >Do you know?
>
> Also if you go to <http://reference.perl.com/>  You will find
> referenced there a variety of scripts, Modules, utilities etc in a
> range of categories.
>
> /J\

I'm working on a web site that will have tons of snippets with
search/filter functionality.

There's no way to remember everything and organizing things on "one
function-one snippet" basis makes lot of sense (at least to me). I always
cut & paste stuff.

There's not much to see so far, but here's link anyway:

www.perlnow.com.

Server is slow, but process is set up and it's a matter of uploading
snippets now.

Cheers,
Dimitri Ostapenko
P.S. Banners are not mine - hosting company's



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

Date: Tue, 13 Apr 1999 23:09:01 +0900
From: =?iso-8859-1?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?= <okmail@hanmail.net>
Subject: Re: Where we can get perl code snippets?
Message-Id: <7evja1$4h4$1@news2.kornet.net>

| 
| There's not much to see so far, but here's link anyway:
| 
| www.perlnow.com.
| 
| Server is slow, but process is set up and it's a matter of uploading
| snippets now.
| 

Thank you! so good site. snippet no means a program. just example code. :)




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

Date: Tue, 13 Apr 1999 14:59:59 +0100
From: Glenn Morgan <gmorgan@photographics.co.uk>
Subject: Win32 IPC
Message-Id: <37134DDF.59600996@photographics.co.uk>

Does any one know of FAQs etc. that will explain to me how the Win32 IPC
modules (semaphores, mutex, etc) work and exactly what each one does.
I've looked in the documentation distrubed with the modules but I don't
really understand.  Perl code examples would be useful too.

Thanks in advance

Glenn



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

Date: Tue, 13 Apr 1999 14:51:53 +0100
From: Glenn Morgan <gmorgan@photographics.co.uk>
Subject: WinNT Services
Message-Id: <37134BF9.780896EA@photographics.co.uk>

I have some perl code running as a service under WinNT v4.0 using the
SRVANY tool found in the NT res kit.

I wondered whether there are any rules, guidelines or advice for writing
apps that are to run as a service.  The sort of thing I'm thinking of
is, how should the app behave when a service is shutdown, etc.  It would
be great if any info/examples were perl specific.


Anyone got any ideas.

Thanks in advance
Glenn



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

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

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