|< 1 2 3 >| | 22 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
use strict;
use warnings;
my $text = "xyz123";
print "0) '$text'\n";
chop(my $text1 = $text);
print "1) '$text1'\n";
my $text2 = join '', (split //, $text)[0..length($text)-2];
print "2) '$text2'\n";
my $text3 = substr $text, 0, length($text)-1;
print "3) '$text3'\n";
my $text4 = join '', splice(@{[split //, $text]}, 0, length($text)-1);
print "4) '$text4'\n";
(my $text5 = $text) =~ s/.$//;
print "5) '$text5'\n";
1
2
3
4
5
6
7
data menge2;
format kopie $10.;
informat kopie $10.;
set menge;
kopie = original;
run;
1
2
3
4
5
6
7
8
use Data::Dumper;
$foo = "bla\n";
$foo =~ s/.$//;
warn Dumper $foo; # falsches Zeichen entfernt
$foo = "bla\n";
$foo =~ s/.\z//s;
warn Dumper $foo; # ah!
$var =~ s#/\z##;
chop $text if substr($text, -1, 1) eq '/';
|< 1 2 3 >| | 22 Einträge, 3 Seiten |