"Leaning Toothpicks" across OSs

"Leaning Toothpicks" across OSs

am 24.02.2010 17:08:24 von Deane.Rothenmaier

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"



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_=--


--===============0547280364==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0547280364==--

RE: "Leaning Toothpicks" across OSs

am 24.02.2010 17:10:27 von Wayne Simmons

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@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
Deane.Rothenmaier@walgreens.com
Sent: Wednesday, February 24, 2010 9:08 AM
To: activeperl@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

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">


charset=3Dus-ascii">

namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"City"/>
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>









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.



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>- w:st=3D"on">Wayne



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 





style=3D'font-size:10.0pt;
color:navy'>--

Software Engineer

InterSystems USA, Inc.

303-858-1000

 
=







size=3D3
face=3D"Times New Roman">






style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:
size=3D2
face=3DTahoma>
activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] style=3D'font-weight:
bold'>On Behalf Of
Deane.Rothenmaier@walgreens.com

Sent: Wednesday, February =
24, 2010
9:08 AM

To:
activeperl@listserv.ActiveState.com

Subject: "Leaning
Toothpicks" across w:st=3D"on">OSs





style=3D'font-size:
12.0pt'> 



style=3D'font-size:
12.0pt'>

style=3D'font-size:10.0pt;
font-family:sans-serif'>O Wise Ones,




style=3D'font-size:10.0pt;font-family:sans-serif'>(Slap
me twice for this one--got my operating systems mixed up!)
=




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.....





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.
=




style=3D'font-size:10.0pt;font-family:sans-serif'>Thanks!




style=3D'font-size:10.0pt;font-family:sans-serif'>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--


--===============1929167423==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1929167423==--

RE: "Leaning Toothpicks" across OSs

am 24.02.2010 17:23:28 von Brian Raven

From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
Deane.Rothenmaier@walgreens.com
Sent: 24 February 2010 16:08
To: activeperl@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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: "Leaning Toothpicks" across OSs

am 24.02.2010 17:26:53 von eroode

On February 24, 2010, Deane.Rothenmaier@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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: "Leaning Toothpicks" across OSs

am 24.02.2010 17:27:43 von David Jacoby

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@listserv.ActiveState.com
> [mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
> Deane.Rothenmaier@walgreens.com
> Sent: 24 February 2010 16:08
> To: activeperl@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@purdue.edu
Purdue University Phone: 765.49.67368
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: "Leaning Toothpicks" across OSs

am 24.02.2010 18:55:01 von Curtis Leach

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@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of David
Jacoby
Sent: Wednesday, February 24, 2010 8:28 AM
To: activeperl@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@listserv.ActiveState.com
> [mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
> Deane.Rothenmaier@walgreens.com
> Sent: 24 February 2010 16:08
> To: activeperl@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@purdue.edu
Purdue University Phone: 765.49.67368
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs