Hi -

This works:

my $folder = "foldername";
my $string1 = "\\\\server\\alias\\*****\\file\\";

my $result = $string1;
$result =~ s/\*\*\*\*\*/$folder/;
print "$result\n";

The * must be escaped with the \ (\*) in the substitution.

Also, note that I had to escape \ to \\ in your $string1.
You may want to write it as:

my $string1 = "//server/alias/*****/file/";

Perl magically turns / to \ if required by your OS
(and you don't have to escape /).
-----Original Message-----
From: chris [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 13, 2002 12:57 PM
To: [EMAIL PROTECTED]
Subject: How to translate "\\server\alias\*****\file\" with $folder?


I have a mask in "\\server\alias\*****\file\". The asterisks will be
assigned the value of a variable. Any ideas?

my $folder = "foldername";
my string1 = "\\server\alias\*****\file\";

# how to make string1 = \\server\alias\foldername\file\

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to