Re: divide a text file

2002-07-28 Thread Steve Grazzini
Jose Bento <[EMAIL PROTECTED]> wrote: > > I have a text file (*.doc) that have a list of articles all of them > separated by the some sequence of characters (). > > How can I divide this file into several files each one with only one > article? > Assuming they aren't huge articles... #!/u

Re: file timestamp monitoring

2002-07-29 Thread Steve Grazzini
Jason Viloria <[EMAIL PROTECTED]> wrote: > > Can someone help me plaease use perl to monitor the timestamp > of a text file to alert me if it is more than 1 minute old and run > an external program if so? > > I suppose a simple script which runs in cron would do the job but > maybe someone els

Re: Post to a second CGI script

2002-07-30 Thread Steve Grazzini
Jim Lundeen <[EMAIL PROTECTED]> wrote: > > I have 2 scripts. One accepts 3 values LOGIN_USERNAME, LOGIN_PASSWORD > and ACTION from an HTML form. That script looks in a user table in > MySQL to verify the user. If valid, it passes them to MENU.CGI with > LOGIN_USERNAME and a unique session numb

Re: flock(); with strict subs

2002-08-02 Thread Steve Grazzini
Kyle Babich <[EMAIL PROTECTED]> wrote: > How do I flock(); with strict subs in effect? flock is a builtin. flock($fh, 2); If you want the symbolic constants, you need to use Fcntl qw/:flock/; flock($fh, LOCK_EX); -- Steve perldoc -qa.j | perl -lpe '($_)=m("(.*)")' -- To unsubscribe,

Re: Probably a simple problem

2002-08-16 Thread Steve Grazzini
Patricia Gillard <[EMAIL PROTECTED]> wrote: > Thanks!! But reading at that site, it says, "They must run under Perl > 5.004_04 or later. Any earlier Perl than this is pre-historic and can > therefore be safely ignored." and the version the host offers is 5.005_03. > > Looks like I'll be learning

Re: Create an output file using Perl

2002-08-28 Thread Steve Grazzini
Alex B. <[EMAIL PROTECTED]> wrote: ... >>> --- Allen Wang <[EMAIL PROTECTED]> wrote: >>> > >>> > i want to generate an output file using perl >>> > >>> > open (OFILE, " > /tmp/aa.lst") >>> > or die "Can't write $p_OutputFile: $! "; >>> > >>> > Everytime I ran it, I got the following error

Re: foo-bar

2002-09-02 Thread Steve Grazzini
Alex B. <[EMAIL PROTECTED]> wrote: > > this is a very simple question: > > what does FOO or BAR or FOOBAR mean??? > -- Steve perldoc -qa.j | perl -lpe '($_)=m("(.*)")' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Re: Cannot validate dynamic html with W3C because of missing Character Encoding

2002-10-06 Thread Steve Grazzini
Todd Wade <[EMAIL PROTECTED]> wrote: > Todd Wade wrote: >> See about upgrading CGI.pm. My start_html() outputs a XHTML transitional >> dtd and a XML processing instruction that has the document encoding. My >> docs validate fine. If its not your server, put CGI.pm in one of your >> directories, an

Re: question about "use MODULE"

2002-10-21 Thread Steve Grazzini
Wiggins D'Anconia <[EMAIL PROTECTED]> wrote: > MMKHAJAH wrote: >> I wonder wether 'use module' compiles only once. I mean that >> all sebsequent calls don't involve compiling. >> > My *guess* is no because that would be silly. > > My *semi-proof* is if you have use warnings on and your program

Re: An if statement

2002-10-24 Thread Steve Grazzini
Gary Stainburn <[EMAIL PROTECTED]> wrote: > unlink $file if -e $file; > > if (-e $file) { > for($i = 0; $i < 10; $i++) { > sleep(1); > } > unlink $file; > } > > The if statement controls access to the block following it. The > condition is only checked once, so the answer to the fi

Re: Forking a subroutine?

2002-10-24 Thread Steve Grazzini
Octavian Rasnita <[EMAIL PROTECTED]> wrote: > > If I want to run a code in background, do I need to fork another > program, or it is possible to fork a subroutine from the same > program that uses the fork function? > You can do whatever you want in the child. defined (my $pid = fork) o

Re: look arounds

2003-07-06 Thread Steve Grazzini
On Sun, Jul 06, 2003 at 11:20:03AM -, mark sony wrote: > $_ = "The brown fox jumps over the lazy dog"; > /the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i; > print "color = $color, animal = $animal\n"; > > When I run the program it gives :color = , animal = > > I took it from thi

Re: look arounds

2003-07-07 Thread Steve Grazzini
On Mon, Jul 07, 2003 at 01:00:22PM +0100, Rob Dixon wrote: > Steve Grazzini wrote: > > On Sun, Jul 06, 2003 at 11:20:03AM -, mark sony wrote: > > > $_ = "The brown fox jumps over the lazy dog"; > > > /the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal =