08-30-05 11:00 PM
On 2005-08-30, yezi <ye_line@hotmail.com> wrote:
> HI, Everyone:
>
> I have question regarding to the PERL code. The task is open a tons of
> files one by one according to the serial number order and process the
> context in these files.However the file should be specified by the
> serial number and site name.
>
> The name of file has structure like that:
> serial number. site name . * .like :
>
> 0.site1.1.23.txt.rd.ed
> 1.site1.2.23.txt.rd.ed
> 3.site1.3.24.txt.rd.ed
>
> which means only one column "site1" is same, so my question is can I
> write following code to open them ?
>
> open myfile,"$serial.$site.*.ed" or die "Could not open file
> $serial.$site for reading/n";
>
> Can I use * in the open file function? I tried, but fail. I do not know
> why, how to relize the function?
>
> thanks for any comments
>
Use the glob command.
$ perldoc -f glob
[ Post a follow-up to this message ]
|