Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]File::Basename[/green] [red]qw([/red][purple]fileparse[/purple][red])[/red][red];[/red]
[black][b]use[/b][/black] [green]File::Spec::Functions[/green] [red]qw([/red][purple]catdir catfile[/purple][red])[/red][red];[/red]
[black][b]use[/b][/black] [green]strict[/green][red];[/red]
[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$basedir[/blue] = [red]'[/red][purple]C:/root/sub[/purple][red]'[/red][red];[/red]
[black][b]my[/b][/black] [blue]$textdir[/blue] = [maroon]catdir[/maroon][red]([/red][blue]$basedir[/blue], [red]'[/red][purple]text[/purple][red]'[/red][red])[/red][red];[/red]
[url=http://perldoc.perl.org/functions/opendir.html][black][b]opendir[/b][/black][/url][red]([/red]DIR, [blue]$textdir[/blue][red])[/red] or [url=http://perldoc.perl.org/functions/die.html][black][b]die[/b][/black][/url] [red]"[/red][purple]Can't opendir [blue]$textdir[/blue]: [blue]$![/blue][/purple][red]"[/red][red];[/red]
[olive][b]foreach[/b][/olive] [black][b]my[/b][/black] [blue]$file[/blue] [red]([/red][url=http://perldoc.perl.org/functions/readdir.html][black][b]readdir[/b][/black][/url][red]([/red]DIR[red])[/red][red])[/red] [red]{[/red]
[black][b]my[/b][/black] [red]([/red][blue]$name[/blue], [url=http://perldoc.perl.org/functions/undef.html][black][b]undef[/b][/black][/url], [blue]$suffix[/blue][red])[/red] = [maroon]fileparse[/maroon][red]([/red][blue]$file[/blue], [red]qr{[/red][purple][purple][b]\.[/b][/purple][^[purple][b]\.[/b][/purple]]*[/purple][red]}[/red][red])[/red][red];[/red]
[olive][b]next[/b][/olive] [olive][b]if[/b][/olive] [blue]$suffix[/blue] ne [red]'[/red][purple].txt[/purple][red]'[/red][red];[/red]
[black][b]my[/b][/black] [blue]$from[/blue] = [maroon]catfile[/maroon][red]([/red][blue]$textdir[/blue], [blue]$file[/blue][red])[/red][red];[/red]
[black][b]my[/b][/black] [blue]$to[/blue] = [maroon]catfile[/maroon][red]([/red][blue]$basedir[/blue], [red]"[/red][purple][blue]$name[/blue].html[/purple][red]"[/red][red])[/red][red];[/red]
[url=http://perldoc.perl.org/functions/print.html][black][b]print[/b][/black][/url] [red]"[/red][purple][blue]$from[/blue] -> [blue]$to[/blue][purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
[red]}[/red]
[url=http://perldoc.perl.org/functions/closedir.html][black][b]closedir[/b][/black][/url][red]([/red]DIR[red])[/red][red];[/red]