Re: Safely updating a file

2011-11-23 Thread Mark Wagner
On Tue, Nov 22, 2011 at 15:33, tshtatland wrote: > On Nov 22, 4:27 pm, carni...@gmail.com (Mark Wagner) wrote: >> I want to update a status file, similar to this: >> >> open OUTFILE, ">", "status.txt"; >> print OUTFILE "$last_date\n"; &

Safely updating a file

2011-11-22 Thread Mark Wagner
can I update the file while preserving the previous contents if something goes wrong? -- Mark Wagner -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Perl modules that "phone home"

2011-07-29 Thread Mark Wagner
ny, of the > customers information may be compromised. > Most Perl modules are ordinary text files, so grepping around in the modules directory for things like "mailsrv" or "wdfgh" should tell you which modules are responsible. -- Mark Wagner -- To unsubscribe, e-mail

Re: Larry's filename fixer

2009-10-16 Thread Mark Wagner
xplanations welcome. IIRC, under *nix, the shell expands it, while under Windows, Perl expands it. It doesn't really matter, because by the time @ARGV is populated, it's been expanded and the script only ever sees the expansion. -- Mark Wagner -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Taint mode & user supplied file names

2009-08-26 Thread Mark Wagner
accidentally let remote users retrieve any arbitrary file, including (in the most popular attack) the forum's username/password list. -- Mark Wagner -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: LWP getting special (multibyte) characters from webpages

2009-01-02 Thread Mark Wagner
On Fri, Dec 26, 2008 at 12:03, John Refior wrote: > Hello, > > I am writing Perl scripts that go to webpages, download certain content, > and then create a CSV file with the relevant data. I am trying to be a > friendly web robot, so I am using the LWP::RobotUA module. > my $page = $r

Re: Why is my regex so slow?

2008-10-31 Thread Mark Wagner
I probably should have specified: the program in my first email is a minimal sample that can reproduce the problem. The original program is significantly longer and more complex. On Fri, Oct 31, 2008 at 14:38, Li, Jialin <[EMAIL PROTECTED]> wrote: > > print "Match\n" if($target =~ /^$regex$/o);

Re: signal processing INT or TERM

2008-10-31 Thread Mark Wagner
;sigusr; while(!$done) { # Do something } # Clean up and exit -- It won't work if "do something" is perpetually blocked on a read or somesuch, but if you wake up periodically to go through the loop, you'll be fine. -- Mark Wagner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Why is my regex so slow?

2008-10-31 Thread Mark Wagner
ing Perl 5.8.8. To see the problem I'm having, download http://download.wikimedia.org/eswiki/20081018/eswiki-20081018-all-titles-in-ns0.gz (a 4.1-MB file), unzip it, and run the program supplying the name of the unzipped file. Thanks, Mark Wagner -- binmode STDIN, ":utf8&q

Re: Text to hex

2008-05-10 Thread Mark Wagner
On Fri, May 9, 2008 at 10:02 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > Mark Wagner wrote: >> >> Given a string of text, how do I convert it to a string of hexadecimal >> values? For example, given the string "Hello", I want the string "48 >>

Text to hex

2008-05-09 Thread Mark Wagner
Given a string of text, how do I convert it to a string of hexadecimal values? For example, given the string "Hello", I want the string "48 65 6C 6C 6F". -- Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Using PERL to retrieve MP3s

2008-04-03 Thread Mark Wagner
On 4/3/08, Jim <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to write a PERL script to retrieve a couple of podcasts > per week. > > Using use XML::RSS::TimingBot I can retrieve and print the .rss file, > but how do I extract the actual mp3 URL from $response->content? Using a suitable regu

Re: Question about CGI.pm

2008-03-25 Thread Mark Wagner
t(), defaults(), checkbox(), checkbox_group(), popup_menu(), optgroup(), scrolling_list(), hidden(), and image_button() all escape all the interesting parameters. Nothing else calls escapeHTML. -- Mark Wagner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to search manual for "use strict"

2008-03-13 Thread Mark Wagner
On 3/13/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I want to read the installed perl manual on "use strict", so how do I search > the perl manual for "use strict" Does "perldoc strict" not work for you? -- Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

Dependancies

2008-02-18 Thread Mark Wagner
Is there any easy way to get a list of all modules loaded by a Perl script? -- Mark Wagner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: lstat and its uses

2008-02-11 Thread Mark Wagner
in an "undef" in place of any variable you don't want, and I believe you can omit trailing "undef"s. -- Mark Wagner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Using 'sendmail'

2008-01-03 Thread Mark Wagner
On 1/2/08, Gurpreet Singh <[EMAIL PROTECTED]> wrote: > Hi All, > > I am a beginner of perl and sorry if I am asking something silly. > I have written the following code using some pre-made scripts on net. > open (MAIL,"|/usr/sbin/sendmail"); > print MAIL "To: $to\n"; If you're providing the reci

Re: Invalid Unicode

2007-11-20 Thread Mark Wagner
On Nov 20, 2007 8:22 PM, Tom Phoenix <[EMAIL PROTECTED]> wrote: > Are you trying to ask, will Perl prohibit the use of invalid Unicode > characters? Perl strings should be safe for any data. That's basically what I needed to know, thanks. -- Mark Wagner -- To unsubscrib

Re: Invalid Unicode

2007-11-20 Thread Mark Wagner
On Nov 20, 2007 7:28 PM, Tom Phoenix <[EMAIL PROTECTED]> wrote: > > On 11/20/07, Mark Wagner <[EMAIL PROTECTED]> wrote: > > I've got a program where I could greatly simplify things by > > temporarily replacing strings with single characters. However, the >

Invalid Unicode

2007-11-20 Thread Mark Wagner
unter from using code points beyond what Unicode defines (0x11 and above)? Thanks, Mark Wagner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: String processing

2007-10-23 Thread Mark Wagner
On 10/23/07, Matthew Whipple <[EMAIL PROTECTED]> wrote: > Mark Wagner wrote: > > I'm working on a program to process Wikipedia pages. Wikipedia pages > > can contain templates of the form: > > > > {{template name > > |key = value > > |key2 = value

String processing

2007-10-23 Thread Mark Wagner
I'm working on a program to process Wikipedia pages. Wikipedia pages can contain templates of the form: {{template name |key = value |key2 = value2 |... }} Any value may in turn be a template, with essentially no limit to the level of nesting. Given a "key = value" pair, how would I go about re

Re: Limiting a program to a single running instance

2007-10-03 Thread Mark Wagner
n can check to see if that process is > still alive and running the same application. If not, remove the file > and continue. Thanks. I've set this up, and it seems to be working. -- Mark Wagner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Limiting a program to a single running instance

2007-10-03 Thread Mark Wagner
ate the > file. Remove the file at end of execution or upon death of script (in the > END block). > > I haven't thought out all the ways that could go wrong. Comments welcome. Will an END block get executed even if the script exits through an error such as calling an undefined fu

Limiting a program to a single running instance

2007-10-03 Thread Mark Wagner
looking for the second copy to know that another copy is running and exit after logging a message to that effect. Any method needs to work properly if the first copy crashes rather than exiting cleanly. Thanks, Mark Wagner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,