in reply to Dylan - For the sites they are a-changin'
As a minor nit, I advise to use the three-argument form of open whenever possible (ie when you're not working with pipes; that is planned for a later version of Perl5 too though) for a variety of reasons. No, they don't really apply here, but it's good habit.use Digest::MD5 qw(md5_hex); ... my $fileMd5 = md5_hex($text) . $ext;
And finally, for the Unixers out there using Mozilla, it can be adapted using the following code:open(my $fh, ">", $fileMd5) or warn("Could not create ($fileMd5)\n"), +next;
For the Windows Mozillaites, that will be something like this (but don't quote me on it, since I have neither used Win32::Process nor any desire to expand my experience with that OS):if(system(mozilla => -remote => 'ping()')) { warn "mozilla not found!"; my $pid = fork; die "Couldn't fork: $!" if not defined $pid; exec { 'mozilla' } 'mozilla' if $pid == 0; } # and changing the command like so: # (obviously, use "new-window" if you prefer that) my $commandShow = q{mozilla -remote "openurl(%s, new-tab)"};
I also attached a patch for your downloadable script to make these changes (posted in a separate node to avoid confusion with the code blocks in this one).Win32::Process::Create( my $process, "mozilla.exe", # maybe needs absolute path, dunno "", 0, NORMAL_PRIORITY_CLASS, "." ) || die ErrorReport() if system(mozilla => -remote => 'ping()');
Makeshifts last the longest.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Dylan - For the sites they are a-changin' (patch)
by Aristotle (Chancellor) on Apr 25, 2003 at 13:22 UTC |