s/&/\n/g
s/\&/ /g
1 2 3 4 5 6 7 8 9
use Data::Dumper; # nur Zur Debugausgabe! my $text = "123&ZAHL"; print "Vorher: ", Data::Dumper::Dumper $text; $text =~ s/\&/ /g; print "Nachher: ", Data::Dumper::Dumper $text;
1
2
perl -wle ' my $t = "Hallo & Gruess Gott."; $t =~ s/&/,/; print ">$t<"; '
>Hallo , Gruess Gott.<
ICAC=0&MFWD_NUM3=XXX&MFWD_NUM4=XXX&H_ABOPROFILID=3&RPCID=0&ACR_ON=0&MFWD_MODE=0&IN_APPLICAB=0&ACCESSNAME=SIP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
perl -wle '
my $t = "ICAC=0&MFWD_NUM3=XXX&MFWD_NUM4=XXX&H_ABOPROFILID=3&RPCID=0&ACR_ON=0&MFWD_MODE=0&IN_APPLICAB=0&ACCESSNAME=SIP";
$t =~ s/&/\n/g;
print $t;
'
ICAC=0
MFWD_NUM3=XXX
MFWD_NUM4=XXX
H_ABOPROFILID=3
RPCID=0
ACR_ON=0
MFWD_MODE=0
IN_APPLICAB=0
ACCESSNAME=SIP
exec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl -w
########################
# Modul Definition
#########################
use strict;
##########################
# Parameter Definition
#########################
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst);
my ($date,$clock);
my ($HOME,$File1,$File2);
my ($ShellCommand,$extNUM,$last_nbs,$extDATA,$extPWD,$extLogin,$extDomain,$extProfile);
my @Array;
##########################
##########################
system("clear");
##########################
# Time-Calculation
##########################
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$date =sprintf("%04d-%02d-%02d",$year+1900,$mon+1,$mday);
$clock =sprintf("%02d:%02d:%02d",$hour,$min,$sec);
###############################
# File-Operation
$File2 = "/home/admin/workspace/".$date."_ExtCheck.log";
if ( -e $File2 ){
open (iFile,"<$File1") || die $!;
open (oFile,">$File2") || die $!;
}
$ShellCommand = '/usr/bin/get_entry EXT ';
$extNUM = '38164835036';
$extDATA = exec($ShellCommand.$extNUM.' EXTENSIONNAT=3'); # Run Shell-Command
$extDATA =~ s/&/\n/g;
print $extDATA;
1 2 3 4
$extDATA = qx($ShellCommand.$extNUM.' EXTENSIONNAT=3'); die "$ShellCommand failed" if not length ($extDATA); $extDATA =~ s/&/\n/g; print $extDATA;