Hi Perl Monks,
I am a beginner in perl programming. Can you help me to sort out a simple problem in perl script writing? I have used a map function in the middle of a program i.e.
say $_ for map {sprintf (“%d”, length)} split/$motif/, $string;It works nicely in command prompt in Windows XP and shows the results correctly. But I want the results of this line (e.g. 0 6 7 8 4 etc. ) printed in a .txt or .docx page as output. So, I need to assign the result of this code to a variable like $a or @a for use in print command like print ”$a or @a”;.
I searched for references in Google but those references have not worked in my program. I shall appreciate if any perl monk can help me sort out this problem by assigning a suitable variable to the output of this code to get the result as print ”$a or @a “; in my program.
In reply to Request to sort out a problem in perl program for getting result as print "@a or $a" of a map function code by supriyoch_2008
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |