Let it be more convenient to use the 3rd-party unix-like sh shells with/from Win32-ish Perls.

This code is written as a module so that it is convenient to use from the command line. See the SYNOPSIS section in the embedded POD, below.

package US; use strict; use warnings; use vars qw($VERSION @ISA @EXPORT); sub rightway; $VERSION ='0.01'; use base 'Exporter'; @EXPORT = ('rightway'); =head1 NAME US.pm - correct slash orientation in file path specs from native Win32 + to Perl-canonical form. =head1 VERSION This documentation describes version B<0.01> of US. =head1 SYNOPSIS use US; use Win32; use File::Glob 'bsd_glob'; { local $\ = "\n"; print for glob( rightway Win32::GetShortPathName(Win32::GetFolderPath(Win32:: +CSIDL_COMMON_DOCUMENTS)) . "/*") ; } =head1 DESCRIPTION Makes it more convenient to use the 3rd-party unix-like sh shells with +/from Win32-ish Perls. "US" as a name was not chosen with a nationalistic or xenophobic inten +tion. The author expects to use this code mainly from the commandline (in "1-liners" as + we say in Perl), and as such a short, easy to remember name is a matter of convenience. + Ok? "U"=="Unix", "S"=="Slash". Thus, "US.pm". =cut =head1 EXPORTED FUNCTIONS =head2 rightway =cut sub rightway ($) { my $pstr = shift @_; $pstr=~ s{\\}{/}g; $pstr; } 1; # US like all modules, should return "TRUE". __END__ =head1 AUTHOR, WARRANTY, COPYRIGHT, & LICENCE INFO NO COPYRIGHT, NO WARRANTY, USE AT OWN RISK. Created Oct 25 2006 by Soren Andersen. This code is considered by the author to be so obvious and trivial that he hereby releases all claim of rights to (and disclaims any responsibility for) the code, and places it in the PUBLIC DOMAIN. Last modified: 25 Oct 2006 at 09:31 AM EDT =cut

In reply to rightway from US.pm by Intrepid

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.