The repository contains a collection of different programming snippets to different programming languages from own developments as well as other projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
programming-examples/perl/String/chomp matches the input lin...

13 lines
277 B

If they do, chomp removes them.
#!/usr/local/bin/perl
$/ = "::"; # set input line separator
$scalar = "testing::";
$num = chomp($scalar);
print ("$scalar $num\n");
@list = ("test1::", "test2", "test3::");
$num = chomp(@list);
print ("@list $num\n");