Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
MD5 is way outdated. You should use Digest::MD5 instead. This makes it
use Digest::MD5 qw(md5_hex); ... my $fileMd5 = md5_hex($text) . $ext;
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.
open(my $fh, ">", $fileMd5) or warn("Could not create ($fileMd5)\n"), +next;
And finally, for the Unixers out there using Mozilla, it can be adapted using the following code:
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)"};
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):
Win32::Process::Create( my $process, "mozilla.exe", # maybe needs absolute path, dunno "", 0, NORMAL_PRIORITY_CLASS, "." ) || die ErrorReport() if system(mozilla => -remote => 'ping()');
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).

Makeshifts last the longest.


In reply to Re: Dylan - For the sites they are a-changin' by Aristotle
in thread Dylan - For the sites they are a-changin' by jplindstrom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-19 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found