Skip to main content
in place modification
Source Link
row
  • 200
  • 8

Use the chomp function to remove trailing newline (\n) from the user input.

my $directory = chomp(<STDIN>);<STDIN>; #"/media"; chomp($directory); 

Use the chomp function to remove trailing newline (\n) from the user input.

my $directory = chomp(<STDIN>); #"/media"; 

Use the chomp function to remove trailing newline (\n) from the user input.

my $directory = <STDIN>; #"/media"; chomp($directory); 
Source Link
row
  • 200
  • 8

Use the chomp function to remove trailing newline (\n) from the user input.

my $directory = chomp(<STDIN>); #"/media";