RE: [PBML] Variable in split function
>You sure? it works fine here:
> Hi all,
> Can we use a variable in the /PATTERN/ argument of the split
> function. I tried it but was not able
> to get it to work. Is there something I am missing??
> $pattern = ":";
> @Arr = split(/$pattern/, $Line);
> puts the whole $Line as the first element in the array
> without splitting.
$line = "test:this:now";
$pattern = ":";
@Arr = split(/$pattern/, $line);
print "$_\n" for @Arr;