Gossamer Forum
Home : General : Perl Programming :

Simple $vars question

Quote Reply
Simple $vars question
I'm just writing a script and wish to print a word right after a variable name like:

Code:
$path =~ s,^(.*/).*$,$1,;

-d "Templates" or die $self->error("Not a directory : $pathTemplates");

(The templates directory is the "Templates" bit after $path in the error message.

However perl is obviously looking for a variable called $pathTemplates - to get arount this I've changed it to $path\Templates but does anyone know of a better way?

Last edited by:

PaulWilson: Sep 18, 2001, 6:06 AM
Quote Reply
Re: [PaulWilson] Simple $vars question In reply to
Hehe I just changed.....

$path =~ s,^(.*/).*$,$1,;

to

$path =~ s,^(.*)/.*$,$1,;

...and used $path/Templates

I'd still like to know if there is a way to do it though for future reference - or is escaping the only way?

Quote Reply
Re: [PaulWilson] Simple $vars question In reply to
Couldn't you try $path . "Templates" or something like that?
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Simple $vars question In reply to
I suppose so.

I was just wondering if there was a way to do it within html.

Quote Reply
Re: [PaulWilson] Simple $vars question In reply to
${path}Templates

--Philip
Links 2.0 moderator
Quote Reply
Re: [junko] Simple $vars question In reply to
I knew there was a way :)

Thanks Drew!