chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
chomp(my $input = <STDIN>); my $kinda_secret = get_data($input); if (defined $kinda_secret) { print 'Your secret is: ' , $kinda_secret } else { print 'No soup for you' } sub get_data { my $input = shift; open my $fh, '<' , 'data.file' or return ; my $retval; while (<$fh>) { if (/^$input:(.+?)$/) { $retval = $1; last } } close $fh; $retval } * This source code was highlighted with Source Code Highlighter .
ksurent @ desktop: ~> cat data.file password1: hello1 password2: hello2 ksurent @ desktop: ~> perl -l t.pl password1 Your secret is: hello1 ksurent @ desktop: ~> perl -l t.pl password No soup for you ksurent @ desktop: ~> perl -l t.pl . + Your secret is: hello1 ksurent @ desktop: ~>
use re 'eval';. Well, you never know, for example, complex dynamic regulars are used somewhere. This will lead to the introduction of the code:
ksurent @ desktop: ~> perl -l t.pl (?? {system'id '}) uid = 1000 (ksurent) gid = 100 (users) groups = 16 (dialout), 33 (video), 100 (users) uid = 1000 (ksurent) gid = 100 (users) groups = 16 (dialout), 33 (video), 100 (users) No soup for you ksurent @ desktop: ~>
use re 'eval';in the script there is no, you can get a small piece of code that also does not play into the hands of the developer.
ksurent @ desktop: ~> perl -l t.pl (?? {system'id '}) Eval-group not allowed at runtime, use re 'eval' in regex m / ^ (?? {system'id '}): (. +?) $ / At t.pl line 15, <$ fh> line 1. ksurent @ desktop: ~>
Source: https://habr.com/ru/post/67143/
All Articles