"Leaning Toothpicks" across OSs
This is a multipart message in MIME format.
--===============0547280364==
Content-Type: multipart/alternative;
boundary="=_alternative 0058A98A862576D4_="
This is a multipart message in MIME format.
--=_alternative 0058A98A862576D4_=
Content-Type: text/plain; charset="US-ASCII"
O Wise Ones,
(Slap me twice for this one--got my operating systems mixed up!)
This is one of those silly moments when I can't remember a simple trick,
and I'm too cotton-pickin' lazy to dig through all my Perl books to find
it. I'm maintaining some old DOS code that has pathed Linux filenames
suffering from LTS. you know...
\/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....
I know there's a way to eliminate all that \/ stuff, but I can't think of
it to save my life. I'll gladly accept a Gibbs head-slap (for all you
fellow NCIS fans out there), if it's accompanied by the solution.
Thanks!
Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
224-542-5150
Whoever fights monsters should see to it that in the process he does not
become a monster. And when you look into the abyss, the abyss looks into
you. -- Friedrich Wilhelm Nietzsche
--=_alternative 0058A98A862576D4_=
Content-Type: text/html; charset="US-ASCII"
<br><font size=2 face="sans-serif">O Wise Ones,</font>
<br>
<br><font size=2 face="sans-serif">(Slap me twice for this one--got my
operating systems mixed up!)</font>
<br>
<br><font size=2 face="sans-serif">This is one of those silly moments when
I can't remember a simple trick, and I'm too cotton-pickin' lazy to dig
through all my Perl books to find it. I'm maintaining some old DOS code
that has pathed Linux filenames suffering from LTS. you know...
\/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....</font>
<br>
<br><font size=2 face="sans-serif">I know there's a way to eliminate all
that \/ stuff, but I can't think of it to save my life. I'll gladly
accept a Gibbs head-slap (for all you fellow NCIS fans out there), if it's
accompanied by the solution.</font>
<br>
<br><font size=2 face="sans-serif">Thanks!</font>
<br>
<br><font size=2 face="sans-serif">Deane Rothenmaier<br>
Programmer/Analyst<br>
Walgreens Corp.<br>
224-542-5150<br>
<br>
Whoever fights monsters should see to it that in the process he does not
become a monster. And when you look into the abyss, the abyss looks into
you. -- Friedrich Wilhelm Nietzsche</font>
--=_alternative 0058A98A862576D4_=--
--===============0547280364==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0547280364==--
RE: "Leaning Toothpicks" across OSs
This is a multi-part message in MIME format.
--===============1929167423==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0018_01CAB531.351DC990"
This is a multi-part message in MIME format.
------=_NextPart_000_0018_01CAB531.351DC990
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
I thought perl always accepts the forward slash, regardless of operating
system. "c:/temp" works in windows/dos.
-Wayne
--
Software Engineer
InterSystems USA, Inc.
303-858-1000
_____
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Deane.Rothenmaier [at] walgreens.com
Sent: Wednesday, February 24, 2010 9:08 AM
To: activeperl [at] listserv.ActiveState.com
Subject: "Leaning Toothpicks" across OSs
O Wise Ones,
(Slap me twice for this one--got my operating systems mixed up!)
This is one of those silly moments when I can't remember a simple trick, and
I'm too cotton-pickin' lazy to dig through all my Perl books to find it. I'm
maintaining some old DOS code that has pathed Linux filenames suffering from
LTS. you know... \/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....
I know there's a way to eliminate all that \/ stuff, but I can't think of it
to save my life. I'll gladly accept a Gibbs head-slap (for all you fellow
NCIS fans out there), if it's accompanied by the solution.
Thanks!
Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
224-542-5150
Whoever fights monsters should see to it that in the process he does not
become a monster. And when you look into the abyss, the abyss looks into
you. -- Friedrich Wilhelm Nietzsche
------=_NextPart_000_0018_01CAB531.351DC990
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
..shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"City"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
[at] font-face
{font-family:sans-serif;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>I thought perl always accepts the =
forward
slash, regardless of operating system. “c:/temp” works in
windows/dos.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>-<st1:City w:st=3D"on"><st1:place =
w:st=3D"on">Wayne</st1:place></st1:City><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p><font size=3D2 color=3Dnavy face=3D"Times New Roman"><span =
style=3D'font-size:10.0pt;
color:navy'>--<br>
Software Engineer<br>
InterSystems USA, Inc.<br>
303-858-1000<br>
</span></font><font color=3Dnavy><span style=3D'color:navy'> =
</span></font><o:p></o:p></p>
</div>
<div>
<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>
<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>
</span></font></div>
<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>
activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] <b><span =
style=3D'font-weight:
bold'>On Behalf Of </span></b>Deane.Rothenmaier [at] walgreens.com<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Wednesday, February =
24, 2010
9:08 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b>
activeperl [at] listserv.ActiveState.com<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> "Leaning
Toothpicks" across <st1:City w:st=3D"on"><st1:place =
w:st=3D"on">OSs</st1:place></st1:City></span></font><o:p></o:p></p>
</div>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
</span></font><font size=3D2 face=3Dsans-serif><span =
style=3D'font-size:10.0pt;
font-family:sans-serif'>O Wise Ones,</span></font> <br>
<br>
<font size=3D2 face=3Dsans-serif><span =
style=3D'font-size:10.0pt;font-family:sans-serif'>(Slap
me twice for this one--got my operating systems mixed up!)</span></font> =
<br>
<br>
<font size=3D2 face=3Dsans-serif><span =
style=3D'font-size:10.0pt;font-family:sans-serif'>This
is one of those silly moments when I can't remember a simple trick, and =
I'm too
cotton-pickin' lazy to dig through all my Perl books to find it. I'm
maintaining some old DOS code that has pathed Linux filenames suffering =
from
LTS. you know... =
\/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....</span></font>
<br>
<br>
<font size=3D2 face=3Dsans-serif><span =
style=3D'font-size:10.0pt;font-family:sans-serif'>I
know there's a way to eliminate all that \/ stuff, but I can't think of =
it to
save my life. I'll gladly accept a Gibbs head-slap (for all you =
fellow
NCIS fans out there), if it's accompanied by the solution.</span></font> =
<br>
<br>
<font size=3D2 face=3Dsans-serif><span =
style=3D'font-size:10.0pt;font-family:sans-serif'>Thanks!</span></font>
<br>
<br>
<font size=3D2 face=3Dsans-serif><span =
style=3D'font-size:10.0pt;font-family:sans-serif'>Deane
Rothenmaier<br>
Programmer/Analyst<br>
Walgreens Corp.<br>
224-542-5150<br>
<br>
Whoever fights monsters should see to it that in the process he does not =
become
a monster. And when you look into the abyss, the abyss looks into you. =
--
Friedrich Wilhelm Nietzsche</span></font><o:p></o:p></p>
</div>
</body>
</html>
------=_NextPart_000_0018_01CAB531.351DC990--
--===============1929167423==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1929167423==--
RE: "Leaning Toothpicks" across OSs
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Deane.Rothenmaier [at] walgreens.com
Sent: 24 February 2010 16:08
To: activeperl [at] listserv.ActiveState.com
Subject: "Leaning Toothpicks" across OSs
> O Wise Ones,
Yeah, right.
>
> (Slap me twice for this one--got my operating systems mixed up!)
Happy to oblige.
>
> This is one of those silly moments when I can't remember a simple
trick, and I'm too cotton-pickin'
> lazy to dig through all my Perl books to find it. I'm maintaining some
old DOS code that has pathed
> Linux filenames suffering from LTS. you know...
\/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....
>
> I know there's a way to eliminate all that \/ stuff, but I can't think
of it to save my life. I'll
> gladly accept a Gibbs head-slap (for all you fellow NCIS fans out
there), if it's accompanied by the
> solution.
Not sure what you mean by eliminate them. Couldn't you just use an
editor to change them to /?
HTH
--
Brian Raven
Please consider the environment before printing this email.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: "Leaning Toothpicks" across OSs
On February 24, 2010, Deane.Rothenmaier [at] walgreens.com wrote:
> This is one of those silly moments when I can't remember a simple
> trick, and I'm too cotton-pickin' lazy to dig through all my Perl
> books to find it. I'm maintaining some old DOS code that has pathed
> Linux filenames suffering from LTS. you know...
> \/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....
In what context do you think you need those backslashes?
In a regular string, you can do 'foo/bar/baz'.
In a regex, you can use the special quoting construct:
$_ =~ m{/foo/bar/baz};
-- Eric
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: "Leaning Toothpicks" across OSs
I agree. Yeah, you could put a regex like
s{\\}{/}gmx
in there, but I'd fix it not work around it.
Brian Raven wrote:
> From: activeperl-bounces [at] listserv.ActiveState.com
> [mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
> Deane.Rothenmaier [at] walgreens.com
> Sent: 24 February 2010 16:08
> To: activeperl [at] listserv.ActiveState.com
> Subject: "Leaning Toothpicks" across OSs
>
>> O Wise Ones,
>
> Yeah, right.
>
>> (Slap me twice for this one--got my operating systems mixed up!)
>
> Happy to oblige.
>
>> This is one of those silly moments when I can't remember a simple
> trick, and I'm too cotton-pickin'
>> lazy to dig through all my Perl books to find it. I'm maintaining some
> old DOS code that has pathed
>> Linux filenames suffering from LTS. you know...
> \/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....
>> I know there's a way to eliminate all that \/ stuff, but I can't think
> of it to save my life. I'll
>> gladly accept a Gibbs head-slap (for all you fellow NCIS fans out
> there), if it's accompanied by the
>> solution.
>
> Not sure what you mean by eliminate them. Couldn't you just use an
> editor to change them to /?
>
> HTH
>
--
Dave Jacoby Address: WSLR S049
Genomics Core Programmer Mail: jacoby [at] purdue.edu
Purdue University Phone: 765.49.67368
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: "Leaning Toothpicks" across OSs
If you really need things to work across different OS, use the
File::Spec module. It's great for platform independent Perl code.
Here's a quick example.
use File::Spec;
my $file = File::Spec->catfile (qw (usr, localfardle whang dang doodle
extc));
print "File: $file\n";
Prints:
File: usr/localfardle/whang/dang/doodle/etc
Which is close.
my $file = File::Spec->catfile ("", qw (usr, localfardle whang dang
doodle extc));
Will put in the leading "/". But there are probably other options that
will force it to put in an absolute path.
There are also other options available if you want to use non-native
file spces. See the docs for this module.
Curtis
-----Original Message-----
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of David
Jacoby
Sent: Wednesday, February 24, 2010 8:28 AM
To: activeperl [at] listserv.ActiveState.com
Subject: Re: "Leaning Toothpicks" across OSs
I agree. Yeah, you could put a regex like
s{\\}{/}gmx
in there, but I'd fix it not work around it.
Brian Raven wrote:
> From: activeperl-bounces [at] listserv.ActiveState.com
> [mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
> Deane.Rothenmaier [at] walgreens.com
> Sent: 24 February 2010 16:08
> To: activeperl [at] listserv.ActiveState.com
> Subject: "Leaning Toothpicks" across OSs
>
>> O Wise Ones,
>
> Yeah, right.
>
>> (Slap me twice for this one--got my operating systems mixed up!)
>
> Happy to oblige.
>
>> This is one of those silly moments when I can't remember a simple
> trick, and I'm too cotton-pickin'
>> lazy to dig through all my Perl books to find it. I'm maintaining
>> some
> old DOS code that has pathed
>> Linux filenames suffering from LTS. you know...
> \/usr\/local\/fardle\/whang\/dang\/doodle\/etc.....
>> I know there's a way to eliminate all that \/ stuff, but I can't
>> think
> of it to save my life. I'll
>> gladly accept a Gibbs head-slap (for all you fellow NCIS fans out
> there), if it's accompanied by the
>> solution.
>
> Not sure what you mean by eliminate them. Couldn't you just use an
> editor to change them to /?
>
> HTH
>
--
Dave Jacoby Address: WSLR S049
Genomics Core Programmer Mail: jacoby [at] purdue.edu
Purdue University Phone: 765.49.67368
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs