my $layout_path = "\$LJHOME/bin/upgrading/s2layers/$layout_name"; my $cgibin_path = "\$LJHOME/cgi-bin/LJ/S2Theme";
So what was happening was that the perl script has a blank value for $LJHOME, and so it ended up trying to edit a file from root (/bin/upgrading... instead of ~/dw/bin/upgrading...). Backslashing the "$" means that perl no longer considers it as a variable, so passes the $LJHOME string straight to your shell/terminal. The shell then uses its $LJHOME variable (which has the proper value).
Also, good idea on setting it to $LJHOME by default! I should edit my script to do that, instead :)
Re: beats head against wall
my $layout_path = "\$LJHOME/bin/upgrading/s2layers/$layout_name";
my $cgibin_path = "\$LJHOME/cgi-bin/LJ/S2Theme";
So what was happening was that the perl script has a blank value for $LJHOME, and so it ended up trying to edit a file from root (/bin/upgrading... instead of ~/dw/bin/upgrading...). Backslashing the "$" means that perl no longer considers it as a variable, so passes the $LJHOME string straight to your shell/terminal. The shell then uses its $LJHOME variable (which has the proper value).
Also, good idea on setting it to $LJHOME by default! I should edit my script to do that, instead :)