Skip to content

Instantly share code, notes, and snippets.

@thecodemedia
Created July 6, 2021 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thecodemedia/422dacddc96eee98e28d3928b21ef580 to your computer and use it in GitHub Desktop.
Save thecodemedia/422dacddc96eee98e28d3928b21ef580 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
$a = 123;
$b = -7.496;
$c = 0xABC; # можно записывать переменные и в шестнадцатеричной форме
$d = ($a + $b) / $c;
$d *= $a; # тоже самое, что $d = $d * $a;
$str1 = "hello";
$str2 = "$str1, world"; # в $str2 будет записано 'hello, world
$str3 = $a."\n".$str2;
$str4 = '$str1'; # в $str4 будет записано '$str1', а не 'hello', потому что кавычки
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment