Here I am trying to get a value. My code is like this
cut -d "|" -f 1,10,13 SMSCDR*$date$hour$minute*.log |grep "Submit|SMPP" |grep "$hour:$min:$sec" |sort |uniq -c`foreach my $min (20 .. 29) { foreach my $sec (@seconds) { my $SMPP_count = split (/[\s]/,(chomp(`cut -d "|" -f 1 +,10,13 SMSCDR*$date$hour$minute*.log |grep "Submit|SMPP" |grep "$hour +:$min:$sec" |sort |uniq -c`)))[0]; print $SMPP_count; } }
I will return
20 Wed Sep 23 06:20:02 2015|Submit|SMPPIn this statement a new line is presented in the last. to remove that I am using chomp. For getting the value I am using split with "\s" (space separator). But its showing error.
Can't modify quoted execution (``, qx) in chomp at second.pl line 24, +near "`cut -d "|" -f 1,10,13 SMSCDR*$date$hour$minute*.log |grep "Sub +mit|SMPP" |grep "$hour:$min:$sec" |sort |uniq -c`)" syntax error at second.pl line 24, near ")[" Global symbol "$SMPP_count" requires explicit package name at second.p +l line 25. Execution of second.pl aborted due to compilation errors.
In reply to using system command in regex by ravi45722
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |