in reply to Remove $

What makes you think it doesn't work?
$_ = 'db1$/SQL/GEMINI/StoredProcs/pboValidateClientRefNo_ClientID.sql' +; s*\$**g; print; #Output: #db1/SQL/GEMINI/StoredProcs/pboValidateClientRefNo_ClientID.sql

You're not using $ inside a double-quoted string are you? $/ is a valid Perl identifier (the input record separator).

update: double quotes stuff
update^2: gah. $/ --> input record separator

Replies are listed 'Best First'.
Re^2: Remove $
by rawsr71 (Novice) on Aug 27, 2007 at 16:00 UTC
    I guess I am inside a double quoted string. I'm receiving the string from an Excel spreadsheet like this:

    my $cellval = $Sheet->Cells($rownum,"B")->{'Value'};
    chomp ($cellval);

    As noted before it comes out like this:
    db1$/SQL/GEMINI/StoredProcs/pboValidateClientRefNo_ClientID.sql

    So how do I then convert that string to literal, remove the $, and flip back to interpreted? (that doesn't read right but I think you get the drift)
      I think there's something else going on. What output do you get if you place a print either side of the substitute? ie

      my $cellval = $Sheet->Cells($rownum,"B")->{'Value'}; print "$cellval\n"; $cellval =~ s*\$**g; print "$cellval\n";

        it turns the $/ into a return

        Z:\Scripts>perl -w $.txt
        db1
        SQL/GEMINI/StoredProcs/pboValidateClientRefNo_ClientID.sql
        db1
        SQL/GEMINI/StoredProcs/pboValidateClientRefNo_ClientID.sql

        Z:\Scripts>