one. DataType (data type ):Perl's data types are roughly four: Scalar (variables), Scalar Array (array), hash array (hash), References (pointer), but they seem to be small but more than sufficient. In particular, you can write a Perl program without
I. Data Types(Data type):
Perl has four data types: Scalar (variable), Scalar Array (Array), Hash Array (Hash), and References (pointer ), it seems to be rare, but it is more than enough to use it. Especially when writing Perl programs, you do not
1. Move through the directory tree.When the program runs with the current working directory as the starting point of the relative path, you can use the chdir operator to change the current directory:chdir " / etc " die " Can ' t chdir to/etc:$! "; #
The first time I came into contact with Perl was in February October 2008. At that time, due to project reconstruction, I needed a lot of text operations, so I picked up the Perl language "text operations as my mission. Of course, the famous llama
I. file input/output functions
1. Basic I/O functions
Open: Allow programs to access files
Close: Terminate File Access
Print: file write string
Write: Write the formatting information to the file.
Printf: format the string and output it to the
Take over the project that others did before, found SVN in the ignore did not deal with the *.db, resulting in the image cached thumbnail files are submitted, and I just open the picture folder, it means that thumbs.db has changed.
There are two
1. Change the Directory
Chdir "/etc" or die "can't chdir to '/etc '! \ N ";
If the parameter is omitted, the system returns to the user's home directory, which is the same as that of CD;
2. wildcard file name
My @ all_files = glob "*"; # files
Perl as a text processing language, will naturally have his recursive writing, the younger brother here to share two examples, I hope to be useful to everyone!Factorial (most classic recursion)#!/usr/bin/perl-s my $Result = 1;sub getresult{my $num =
Use perl to port ls commands in linux to windows-Linux general technology-Linux programming and kernel information. For more information, see the following. File: ls.rar
#! /Usr/bin/perl
Use strict;
# Use Win32: File qw (GetAttributes );
My $ dir
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.