special-variables

Where can I find information about Perl's special variables?

百般思念 提交于 2019-12-04 03:42:01
问题 Perl has quite a few special variables such as @F , $! , %! ... etc. Where are all Perl's special variables documented? 回答1: All special variables used by Perl are documented in perldoc perlvar. You can view this document on your computer by running perldoc perlvar The documentation for a specific special variable can also be accessed at the command line using perldoc -v : perldoc -v @F You may need to escape/quote some variables to avoid interpolation by your shell: perldoc -v '$!' or

Perl special variable “@_” in a subroutine not working

杀马特。学长 韩版系。学妹 提交于 2019-12-02 19:49:19
问题 This script rips out the urls from a downloaded webpage. I had some trouble with this script - when I use the "my $csv_html_line = @_ ;" and then print out the "@html_LineArray" - it just prints out "1's" . When I replace the "my $csv_html_line = @_ ;" with "my $csv_html_line = shift ;" the script works fine. I do not know what the difference is betweeh the "= @_" and shift - becuase I thought that without specifying something, in a subroutine, shift shift froms "@_". #!/usr/bin/perl use

Perl special variable “@_” in a subroutine not working

半腔热情 提交于 2019-12-02 08:16:51
This script rips out the urls from a downloaded webpage. I had some trouble with this script - when I use the "my $csv_html_line = @_ ;" and then print out the "@html_LineArray" - it just prints out "1's" . When I replace the "my $csv_html_line = @_ ;" with "my $csv_html_line = shift ;" the script works fine. I do not know what the difference is betweeh the "= @_" and shift - becuase I thought that without specifying something, in a subroutine, shift shift froms "@_". #!/usr/bin/perl use warnings; use strict ; sub find_url { my $csv_html_line = @_ ; #my $csv_html_line = shift ; my @html