perl search replace doesn't work

I am trying to run a simple search and replace

my @buffer = split /\=/, `metaflac --show-tag=Artist \"$inFile\" 2>&1`;
      my $artist = substr $buffer[1], 0, length($buffer[1])-1;
      $artist = ~ s/\//-/;

for some reason the output of $artist is 18446744073709551615

As soon as i try and search and replace I no longer a string returned only a long number.

I always find i waste the most time on the simplest of thigns in perl
NorthReptileAsked:
Who is Participating?
 
ozoConnect With a Mentor Commented:
perl -MO=Deparse,-p -e '$artist = ~ s/\//-/;'
($artist = (~s[/][-]));

= and ~ here are separate operators


perl -MO=Deparse,-p -e '$artist =~ s/\//-/;'
($artist =~ s[/][-]);

=~ here is a single binding operator
0
 
NorthReptileAuthor Commented:
problem seems to be the space between = and ~!!
0
 
NorthReptileAuthor Commented:
thanks
0
All Courses

From novice to tech pro — start learning today.